Tutorial by Examples

parse_url(): This function parses a URL and returns an associative array containing any of the various components of the URL that are present. $url = parse_url('http://example.com/project/controller/action/param1/param2'); Array ( [scheme] => http [host] => example.com ...
explode(): Returns an array of strings, each of which is a substring of string formed by splitting it on boundaries formed by the string delimiter. This function is pretty much straight forward. $url = "http://example.com/project/controller/action/param1/param2"; $parts = explode(...
basename(): Given a string containing the path to a file or directory, this function will return the trailing name component. This function will return only the last part of an URL $url = "http://example.com/project/controller/action/param1/param2"; $parts = basename($url); // Out...

Page 1 of 1