How to parse an URL in PHP
In this blog i will discuss on URL parsing. `parse_url` function parse a URL and returns an associative array containing any of the various components of the URL that are present. The values of the array elements are not URL decoded. Use below code to parse a URL
$url = 'https://www.code-learn.com/abc/?slug=test'; //Any URL
print_r(parse_url($url));
Output:below code to parse an URL
Array ( [scheme] => https [host] => www.ecode-learn.com [path] => /abv [query] => slug=test )
Also Read: How to increase website speed
In this blog i will discuss on URL parsing. `parse_url` function parse a URL and returns an associative array containing any of the various components of the URL that are present. The values of the array elements are not URL decoded. Use below code to parse a URL
$url = 'https://www.code-learn.com/abc/?slug=test'; //Any URL
print_r(parse_url($url));
Output:below code to parse an URL
Array ( [scheme] => https [host] => www.ecode-learn.com [path] => /abv [query] => slug=test )
Also Read: How to increase website speed
Recommanded Articles
- How to check YouTube video exist Laravel validation
- JQuery AJAX image upload with form data in PHP
- Insert Update Delete in PHP MySQL
- How to make image background transparent using PHP
- Paypal credit card payment on website in PHP
- Capture page screenshot by URL PHP script
- Insert Update Delete Select query in WordPress
- How to parse an URL in PHP
- How to increase website speed
- How to get all UK addresses by postal code
Latest Comments