tags:

views:

32

answers:

2

I'm trying to create an array to use for a curl_multi_exec, but I can't seem to create the array properly.

Here is my code:

        $SQL = mysql_query("SELECT url FROM urls") or die(mysql_error()); //Query the shell table
                                                while($resultSet = mysql_fetch_array($SQL)){    
                                                        $urls[]=$resultSet;
                                                }

echo $urls; //Test that the array works

But when I run this script, all it does is echo "Array"

I have no idea what I'm doing wrong, I've checked around google a bit, but can't figure it out. Any insight would be appreciated.

+2  A: 

print_r($urls) or var_dump($urls)

echo assumes a scalar value.

dnagirl
Aha, that was easy. Much appreciated, I'll keep this in mind for future reference. Also, could link me to something that explains this more in detail? Or explain it yourself? (Also, can't accept answer for another 11 minutes. Bah)
Rob
@dnagirl: +1 for being quick :)
Sarfraz
@Rob: best place for PHP info is the manual (no sarcasm, honest!) http://ca.php.net/manual/en/index.php Have a look here for echo http://ca.php.net/manual/en/function.echo.php, print_r http://ca.php.net/manual/en/function.print-r.php and var_dump http://ca.php.net/manual/en/function.var-dump.php
dnagirl
Thank you dnagirl
Rob
A: 

You can use the print_r() function.

print_r($urls)
Sarfraz