Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteBase /cms_project
- RewriteCond %{REQUEST_URI} single(.*)
- RewriteRule ^(.+)$ single.php?url=$1
- </IfModule>
- //want to query strings single/posts/1/post-title
- echo $_GET['url'];
- OR
- //function to get url query string convert it to an array
- function getUrl() {
- if(isset($_GET['url'])) {
- $url = rtrim($_GET['url'],'/');
- $url = filter_var($url, FILTER_SANITIZE_URL);
- $url = explode('/', $url);
- return $url;
- }
- }
- print_r($_GET['url']);
Add Comment
Please, Sign In to add comment