【发布时间】:2010-10-23 19:30:59
【问题描述】:
下面的代码似乎不起作用或在数组上找不到任何东西。我正在使用“in_array”来搜索堆栈中的针。我还尝试用逗号分隔的内容爆炸并且不起作用。有什么建议?我也试过“array_search”。
$q4 = "SELECT domain_name,slots_config.bid FROM slots_pid,slots_config,slots_sites
WHERE slots_config.bid=slots_pid.bid && slots_sites.aid=slots_pid.aid";
$result4 = mysql_query($q4);
while($row = mysql_fetch_array($result4))
{
$resultarray[] = $row;
}
if (in_array("test",$resultarray))
{
echo "Match found";
}
else
{
echo "Match not found";
}
【问题讨论】: