Php $_GET issue

foreach ($_GET as $field => $label)
   echo "$_GET[$field]";
   echo "<br>";

This is the output I am getting. I see the data is there in datarray but when I echo $_GET[$field]

I only get "Array"

But print_r($datarray) prints all the data. Any idea how I pull those values?

Array ( 
        [0] => Array ( 
                 [0] => Grade1 
                 [1] => ln 
                 [2] => North America 
                 [3] => yuiyyu 
                 [4] => iuy 
                 [5] => uiyui 
                 [6] => yui 
                 [7] => uiy 
                 [8] => 0:0:5 


EDIT: When I completed your test, here was the final URL:

This is probably a malformed URL. When you pass duplicate keys in a query, PHP makes them an array. The above URL should probably be something like:[]=5&answer[]=3&answer[]=no&answer[]=foo&answer[]=blat&time=0%3A0%3A24

This will create individual entries for most of the fields, and make $_GET['answer'] be an array of the answers provided by the user.

Bottom line: fix your Flash file.

Use var_export($_GET) to more easily see what kind of array you are getting.

From the output of your script I can see that you have multiple nested arrays. It seems to be something like:

$_GET = array( array( array("Grade1", "ln", "North America", "yuiyyu", "iuy", "uiyui", "yui","uiy","0:0:5")))

so to get those variables out you need something like:

echo $_GET[0][0][0]; // => "Grade1"

Need Your Help

Can I use iconv to convert multi-byte smart quotes to extended ASCII smart quotes?

php character-encoding iconv extended-ascii

I have some UTF-8 content that includes multi-byte smart quote characters. I've found that this code will easily convert those characters to ASCII straight quotes (ASCII code 34):

Unit Testing basic Controllers

unit-testing zend-framework phpunit code-coverage

I have a number of simple controller classes that use Doctrine's entity manager to retrieve data and pass it to a view.