首页  >  文章  >  后端开发  >  php调用本地php文件问题

php调用本地php文件问题

WBOY
WBOY原创
2016-06-23 14:20:301175浏览

我有一个php文件,要循环一个数组构造一个url数组。

$keywords = keyword_split($res['keywords']);$path='../ajax/search.php?key=';foreach($keywords as $k){	$filename = $path.$k;	$content = 这里怎么调用这个php文件并返回内容???;	var_dump($content);}


回复讨论(解决方案)

$content = file_get_contents($filename);试试

$content = file_get_contents($filename);试试 这个不行。file_get_content不支持带参url


$content = file_get_contents($filename);试试 这个不行。file_get_content不支持带参url

我想了下 带参数的话得带上http协议  http://.................

直接用本地的php文件并且带参数 我还没想到办法.



$content = file_get_contents($filename);试试 这个不行。file_get_content不支持带参url

我想了下 带参数的话得带上http协议  http://.................

直接用本地的php文件并且带参数 我还没想到办法. 还是在页面里写个js用ajax调用吧,还没想到好办法

你的方法加上http走服务器一下就可以了吧

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn