webgui/www/extras/yui/examples/container/assets/post.php
JT Smith cfd09a5cb6 upgraded to yui 0.12.0
upgraded to yui-ext 0.33 rc2
2006-11-28 02:23:34 +00:00

32 lines
No EOL
479 B
PHP

<?php
print "data = { ";
$index = 0;
foreach($_POST as $key => $value) {
print "$key:";
if (gettype($value) == "array") {
print "[";
for ($i = 0;$i < count($_POST["$key"]);$i++) {
$v = $_POST["$key"][$i];
print "\"$v\"";
if ($i < count($_POST["$key"])-1) {
print ",";
}
}
print "]";
} else {
print "\"$value\"";
}
$index++;
if ( ($index) < count($_POST) ) {
print ", ";
}
}
print " };";
?>