正则表达式匹配问题
下面代码始终不执行If后面的语句$roomzx = $db->getOne("SELECT user FROM jz_room WHERE endtime= '0' AND user != 'null' ");
$roomidd = $db->getOne("SELECT id FROM jz_user "); //这里已经读取到user字段里面的值为 {"87":1,"174":1,"136":1}
file_put_contents('log.txt',$roomzx,FILE_APPEND); //这里已经读取到id字段里面的值为 87
file_put_contents('log.txt',$roomidd,FILE_APPEND);
if(preg_match ($roomidd,$roomzx)) {
return tip("您已登录", $connection);
}
$roomzx和$roomidd里面都有87 ,为什么匹配不了呢?请高手指点!
数据库如下