Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/237.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP-文件获取内容无法从URL打开流_Php - Fatal编程技术网

PHP-文件获取内容无法从URL打开流

PHP-文件获取内容无法从URL打开流,php,Php,我有一段代码,它允许我从链接中检索信息。。。现在,它说无法打开流。。。代码如下: 谢谢 $b = time (); $date1 =date( "Y-m-d;h:i:s" , mktime(date("h")+6, date("i"), date("s"), date("m") , date("d"), date("Y"))); $str_time = ""; $str_msg = ""; $str_from = ""; $str_zip = ""; echo file_get_content

我有一段代码,它允许我从链接中检索信息。。。现在,它说无法打开流。。。代码如下:

谢谢

$b = time ();
$date1 =date( "Y-m-d;h:i:s" , mktime(date("h")+6, date("i"), date("s"), date("m") , date("d"), date("Y")));
$str_time = "";
$str_msg = "";
$str_from = "";
$str_zip = "";

echo file_get_contents('href="http://testext.i-movo.com/api/receivesms.aspx?".$str_from."".$str_zip."".$phone."".$str_time."".$date1."".$str_msg.""');
}

有关详细信息,请阅读文档

这个例子说

$homepage = file_get_contents('http://www.example.com/');
echo $homepage;
您正在使用

$homepage = file_get_contents('href="http://www.example.com/');
现在有什么问题吗?

这是:

echo file_get_contents('href="http://testext.i-movo.com/api/receivesms.aspx?".$str_from."".$str_zip."".$phone."".$str_time."".$date1."".$str_msg.""');
应该是这样的:

echo file_get_contents("http://testext.i-movo.com/api/receivesms.aspx?".$str_from.$str_zip.$phone.$str_time.$date1.$str_msg);

您不需要连接空字符串。@SteveRobbins谢谢您的编辑我刚刚删除了不必要的开头和结尾我没有查找空字符串