如何在php循环中运行url
假设我有一个php循环,如下所示:如何在php循环中运行url,php,Php,假设我有一个php循环,如下所示: while($row = mysql_fetch_array($result)){ $phones = $row['phone']; $text = $row['message']; $url = 'http://abcwebsite.com/user.php? '&mobileno=' . $phones . '&message=' . $text; } 这就是在循环中运行url直到循环完成的方法吗?您可以使用数组
while($row = mysql_fetch_array($result)){
$phones = $row['phone'];
$text = $row['message'];
$url = 'http://abcwebsite.com/user.php? '&mobileno=' . $phones . '&message=' . $text;
}
这就是在循环中运行url直到循环完成的方法吗?您可以使用数组收集所有url: 比如:$url=array() 可以在循环内使用$url
$i = 0;
$url = array();
while($row = mysql_fetch_array($result)){
$phones = $row['phone'];
$text = $row['message'];
$url[$i] = 'http://abcwebsite.com/user.php? '&mobileno=' . $phones . '&message=' . $text;
$i++;
}
然后,您可以使用数组
$url
,它包含所有url。什么意思,运行url?尝试文件获取内容($url)
?您知道您的代码在PHP 7(PHP的未来版本)中不起作用吗?mysql\u*
函数很久以来就被弃用了?但是如何执行url..我使用了header()函数,但它只在只获取一行时起作用。