Last active
December 10, 2015 01:08
-
-
Save kjbrum/b094db5c401325ddde43 to your computer and use it in GitHub Desktop.
Match the current URL against the supplied URL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Match the current URL against the supplied URL. | |
* | |
* @param string $url The URL to be checked | |
* @return boolean | |
*/ | |
function current_page_url_in( $url ) { | |
return ( strpos( $_SERVER['REQUEST_URI'], parse_url( $url, PHP_URL_PATH ) ) !== false ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment