Today practice file upload operation, but encountered a very tangled matter
Look directly at the code:
File Upload page: index.html
Insert Title here
File Processing page: test.php
foreach ($_files as $v) {$info =pathinfo ($v [' name ']),//var_dump ($info);//view information in $info;//exit;//echo $info [' Extentsion '];//newspaper hint//exit; $v [' ext ']= $info [' extension '];//get file extension $v[' filename ']= $info [' filename '];//get file name echo $v [ ' ext '];//can get the right extension exit;}
The thing is this, when I echo $info [' extension '] always tip: notice:undefined index:extentsion in D:\WW ....
When I var_dump ($info), there really is "extension" in it.
However, as shown in the code above $v[' ext ']= $info [' extension '); I echo $v [' ext ']; but I can get the correct suffix.
What the hell's the situation?
Reply to discussion (solution)
echo $info [' extentsion '];//news tip
echo $info [' extension '];//news tip
Pay attention to spelling, how can a teenager have a mistake?
The editor does not give the force, the oneself dizzy.
echo $info [' extentsion '];//news tip
echo $info [' extension '];//news tip
Pay attention to spelling, how can a teenager have a mistake?
Last time also because of a letter,,,, how I always so careless