array(2) { [0]=> string(33) "p_large_18SQ_6bcc000198902d14.jpg" [1]"/> array(2) { [0]=> string(33) "p_large_18SQ_6bcc000198902d14.jpg" [1]">

Home  >  Article  >  Backend Development  >  PHP数组里面的值取不出来。该如何处理

PHP数组里面的值取不出来。该如何处理

WBOY
WBOYOriginal
2016-06-13 13:29:021343browse

PHP数组里面的值取不出来。。
用POST提交表单之后:
var_dump($_POST);
输出POST数组的值可以看到:
array(10) { ["picName"]=> array(2) { [0]=> string(33) "p_large_18SQ_6bcc000198902d14.jpg" [1]=> string(33) "p_large_4u3y_64f80006f4305c40.jpg" } ["p_large_18SQ_6bcc000198902d14_jpgtop"]=> string(5) "290px" ["p_large_18SQ_6bcc000198902d14_jpgleft"]=> string(5) "454px" ["p_large_18SQ_6bcc000198902d14_jpgheight"]=> string(3) "236" ["p_large_18SQ_6bcc000198902d14_jpgwidth"]=> string(3) "150" ["p_large_4u3y_64f80006f4305c40_jpgtop"]=> string(5) "100px" ["p_large_4u3y_64f80006f4305c40_jpgleft"]=> string(5) "500px" ["p_large_4u3y_64f80006f4305c40_jpgheight"]=> string(3) "150" ["p_large_4u3y_64f80006f4305c40_jpgwidth"]=> string(3) "150" ["num"]=> string(1) "2" } 

但是之后再取出POST里面的值的时候,例如_POST[" p_large_18SQ_6bcc000198902d14.jpgtop"]
就会报错:Notice: Undefined index: p_large_18SQ_6bcc000198902d14.jpgtop
可是丫明明在_POST里面啊这是为神马啊= =|||||

------解决方案--------------------
是的,提交的变量名中的 “.”会变成“_”

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn