当前位置:首页>开发>正文

php中怎么调用一个网址 php随机打开文本中的网址?

2023-06-26 11:55:41 互联网 未知 开发

 php中怎么调用一个网址 php随机打开文本中的网址?

php中怎么调用一个网址?

在go.php里面写下面的代码:
$url=$_GET[s]
switch($url){
case zhidao:
header("location:这里是你地址写上就行") exit()
break
//……
}
注意运行php,在地址栏上输入http://localhost/

php随机打开文本中的网址?

$str = file_get_contents("b.txt")
$arr = split(" ",$str)
header(("location:".$arr[array_rand($arr)])

PHP怎么调用网页

a.php
/*不知道你是想跳转还是取回网页内容后显示
$type为TRUE时采用页面跳转方式
$type为FALSE时采用取回内容后显示
*/

$type = TRUE

if( isset( $_GET[url] ) ){
$url = http:// . $_GET[url]
if( $type ){
header("Location: $url")
}else{
$page = file_get_contents($url)
echo $page
}
}else{
echo 未设置URL参数
}
?>

最新文章

随便看看