欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

PHP解析URL并得到URL中的参数_PHP教程

程序员文章站 2024-01-16 08:55:16
...
$param)
    {
        $tmp[] = $k.'='.$param;
    }
    $params = implode('&',$tmp);
    return $params;
}
?>

输出结果:

array (size=4)
  'scheme' => string 'http' (length=4)
  'host' => string 'test.com' (length=8)
  'path' => string '/testdir/index.php' (length=18)
  'query' => string 'param1=10&param2=20&param3=30&param4=40&param5=50&param6=60' (length=59)


array (size=6)
  'param1' => string '10' (length=2)
  'param2' => string '20' (length=2)
  'param3' => string '30' (length=2)
  'param4' => string '40' (length=2)
  'param5' => string '50' (length=2)
  'param6' => string '60' (length=2)


string 'param1=10&param2=20&param3=30&param4=40&param5=50&param6=60' (length=59)


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/755760.htmlTechArticle$param) { $tmp[] = $k.'='.$param; } $params = implode('',$tmp); return $params;}?> 输出结果: array (size=4) 'scheme' => string 'http' (length=4) 'host' => string 'test.com' (...
相关标签: 参数