First, PHP gets the URL of the current page:
Copy the Code code as follows:
Get the current script URLfunction Getcururl (){if (!empty ($_server["Request_uri")){$scriptName = $_server["Request_uri"];$nowurl = $scriptName;}Else{$scriptName =
Example code 1: Get content with file_get_contents in get
Copy CodeThe code is as follows:
$url = ' http://www.baidu.com/';
$html =file_get_contents ($url);
Print_r ($http _response_header);
EC ($html);
Printhr ();
Printarr ($http _response_header)
Share the following PHP read the contents of several methods, different, and we encourage each other.Example code 1: Get content with file_get_contents in get$url = ' http://www.jbxue.com/';$html =file_get_contents ($url);Print_r ($http
The first is PHP to get the current page URL:
Copy Code code as follows:
Get the current script URL
function Getcururl ()
{
if (!empty ($_server["Request_uri"]))
{
$scriptName = $_server["Request_uri"];
$nowurl =
/** * get the contents of a remote file * @parma $url URL * @return Get content * **/ public static function getcontent ($url) {$flag = 0;do {$hCurl = curl_init (); curl_setopt ($hCurl, curlopt_header, 0);
This article mainly introduces the THINKPHP5 URL and routing of the functional details and examples, small series feel very good, and now share to everyone, but also for everyone to do a reference. Follow the small series together to see it, hope to
This article mainly introduces the THINKPHP5 URL and routing of the functional details and examples, small series feel very good, and now share to everyone, but also for everyone to do a reference. Let's take a look at it with a little
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.