在我的剧本,PHP数组变量
$value= array("DK","Bloomsberry","McGrawHill","OXFORD","DC Books","Springer");
if(in_array("Bloomsberry",$value)){
echo "Bloomsberry is there inside the array";}
else{ echo "Bloomsberry is not there ";}
这个效果很好
我有一个变量$names
这是一个MySQL的结果,其中有数据"DK","Bloomsberry","McGrawHill","OXFORD","DC Books","Springer"
像数组数据。
但是当我变量存放内部像$value= array($names);
代替$value= array("DK","Bloomsberry","McGrawHill","OXFORD","DC Books","Springer");
,我得到预期"Bloomsberry is there inside the array"