Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/232.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
从url进行Php查询_Php - Fatal编程技术网

从url进行Php查询

从url进行Php查询,php,Php,我确信这已经在stack上得到了回答,但我不知道用什么合适的术语来找到我想要的结果 我想在url中获取一个值,并将其输入到我的php脚本中。所以如果我去: http://mydomain/search.php=“MYSEARCHQUERY” php将把MYSEARCHQUERY作为一个值 <?php $html=file_get_contents('http://anotherwebsite/MYSEARCHQUERY'); ?> URL类似于: http://mydomain

我确信这已经在stack上得到了回答,但我不知道用什么合适的术语来找到我想要的结果

我想在url中获取一个值,并将其输入到我的php脚本中。所以如果我去:

http://mydomain/search.php=“MYSEARCHQUERY”

php将把
MYSEARCHQUERY
作为一个值

<?php 
$html=file_get_contents('http://anotherwebsite/MYSEARCHQUERY'); 
?>

URL类似于:

http://mydomain/search.php?query=MYSEARCHQUERY
而PHP:

$html = file_get_contents('http://anotherwebsite/' . $_GET['query']); 

URL类似于:

http://mydomain/search.php?query=MYSEARCHQUERY
而PHP:

$html = file_get_contents('http://anotherwebsite/' . $_GET['query']); 

即将进行否决表决,但您的编辑很快被推到我的浏览器+1该投票的地方即将被否决,但您的编辑很快被推到我的浏览器+1在值得的地方