我是 PHP 新手并整理了一些代码。这需要两个电话号码列表......然后将第二个列表中的号码拉出第一个列表,制作一个新的过滤列表。仅拉入一个列表时,完整的代码就可以正常工作。现在我已经修改它以过滤基于第二个列表的列表,代码现在失败了,我收到了这个警告:
警告:第 7 行 /var/www/html/send.php 中的非法字符串偏移量 'phone_number'
// Get all of the phone numbers from the List
$sql = "SELECT phone_number FROM dial_list WHERE list_id='$list'";
$result = mysqli_query($link, $sql);
echo mysqli_error($link);
foreach ($result as $row)
{
$all_people[] = $row['phone_number'];
}
// Get phone numbers from our DNC list
$sql = "SELECT phone_number FROM dial_dnc";
$result = mysqli_query($link, $sql);
echo mysqli_error($link);
foreach ($result as $row)
{
$dnc_people[] = $row['phone_number'];
}
// Remove DNC numbers from list
$filtered_people = array_diff($all_people, $dnc_people);
foreach ($filtered_people as $row)
{
$people[] = $row['phone_number'];
}
第 79 行(警告来自)是: $people[] = $row['phone_number'];
任何帮助查明错误或改进如何完成此过滤将不胜感激!