[Resolved] Pass PHP Array in the URL?
I'm calling a page like this: http://localhost/test.php?a[]=a&a[]=b&a[]=c&a[]=d&a[]=e&a[]=f&a[]=g&a[]=h&a[]=i
And using this code:
PHP Code:
<?php
if (isset($_REQUEST['a'])) {
if (is_array($_REQUEST['a'])) {
for ($i = 0; $i < count($_REQUEST['a']); $i++) {
echo $_REQUEST['a'][$i] . '<br />';
}
}
}
?>
It works perfectly, but I'm wondering if there are any drawbacks to it?
I've never seen anything do it this way before, so it makes me paranoid that there's something wrong with doing it that way.