Posted by bill on 11/18/07 15:13
I want to extract the name of the photo uploaded.
print_r of $_FILES yields:
Files: Array ( [picture] => Array ( [name] =>
DSC_1802-saoirse-riona.jpg [type] => image/jpeg [tmp_name] =>
/tmp/phpJTspHZ [error] => 0 [size] => 76096 ) )
so we have an array with one element, picture, that contains an
array with an index, name, with a value of DSC_1802-saoirse-riona.jpg
I get the correct value when I:
$pic_name = $_FILES['picture']['name'];
echo $pic_name
however when I use:
echo "<br />pic_name = $_FILES[picture][name]";
I get:
pic_name = Array[name]
Why does the echo with the array reference not work while the
assignment does ?
bill
[Back to original message]
|