我正在尝试将一串数字发送到服务器并拆分每个数字。如果数据库中存在数字,则分配“t”值,如果不存在,则分配“f”值。但由于某种原因,我只得到了 t。
<?php
# get phone from uid
include_once 'utils.php';
$phone = $_GET['phone'] or die("isRegistered: missing phone");
$response = "";
$phonearray = explode(":", $phone);
for ($i = 0; $i<sizeof($phonearray); $i++){
$result = findRow("phone", $phonearray[i], "user_device") or "true" ;
if($result == "true")
{
$response = $response."t".":";
$result = "";
}
else
{
$response = $response."f".":";
$result = "";
}
}
die($response);
?>