Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Rameshwar-ghodke/26cc298f88387945d4ea78ed6de33573 to your computer and use it in GitHub Desktop.
Save Rameshwar-ghodke/26cc298f88387945d4ea78ed6de33573 to your computer and use it in GitHub Desktop.
Fetch url with server request and divide it into sepearte function or component wise in php
<?php
$directoryURI = $_SERVER['REQUEST_URI'];
$path = parse_url($directoryURI, PHP_URL_PATH);
$components = explode('/', $path);
$Module = $components[2];
$function = $components[3];
// die();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment