Home  >  Article  >  Backend Development  >  PHP返回值判断有关问题

PHP返回值判断有关问题

WBOY
WBOYOriginal
2016-06-13 13:36:47814browse

PHP返回值判断问题
从一台服务器POST数据到另一台服务器,处理以后我用ECHO 1 返回
但是我接受到以后 用if($results==1)判断不成功,输出$results 确实为1
这种情况应该怎么判断返回值

------解决方案--------------------
if(intval($results)==1)

try it.
------解决方案--------------------
string(7) "??1" 表示你的返回数据包含了 2 个 BOM 头,只有那个 1 是你 “用ECHO 1 返回”的
你可以用 print_r(unpack('H*', $results)); 观察一下
因该是 efbbbfefbbbf30,而 efbbbf 就是 utf-8 编码文件的 BOM 头


 

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