好吧,這裏的情況:PHP值數組存在
$x = array('yo'=>12,'go'=>13);
如何測試一個值是否在數組中或沒有?
例如:
isThereInArray(12) => True or 1 or whatever
isThereInArray(123) => False or 0 or null or -1 or whatever
好吧,這裏的情況:PHP值數組存在
$x = array('yo'=>12,'go'=>13);
如何測試一個值是否在數組中或沒有?
例如:
isThereInArray(12) => True or 1 or whatever
isThereInArray(123) => False or 0 or null or -1 or whatever
in_array()
將幫助你在這裏。
爲了更快速的發展,請參閱PHP文檔,像這樣:
http://au1.php.net/manual-lookup.php?pattern=find+in+array&lang=en&scope=quickref
感謝您的快速回答!我會盡快接受答案! – tenstar
一些秒差異:( –
請檢查存在的問題/你以前的答案添加一個新的。 :-) –
對不起@middaparka我會看到下一次! – tenstar