Advertisement

How to use the wp_parse_url() and wp_parse_str() functions

wp_parse_url() #wp_parse_url() wp_parse_url() is wrapper function for PHP’s parse_url() function that handles consistency in the return values across PHP versions. Example 1: #Example 1: Let’s extract the scheme, host, and path from the URL https://maheshwaghmare.com/ by using the wp_parse_url(). The output of the above code is below: array (size=3) ‘scheme’ => string ‘https’ (length=5) ‘host’