Search text for specific keywords at start and end in php -


i have following string

$url_part = 'p=link&u=shuja&sort=recent'; 

i want string start p= , end & in such way,

$page = 'link';  

and may exist anywhere in $url_parts. remove same that

$url_part = 'u=shuja&sort=recent'; 

$url_part = 'p=link&u=shuja&sort=recent'; $params = array(); parse_str($url_part, $params); $page = isset($params['p']) ? $params['p'] : null; unset($params['p']); $url_part = http_build_query($params); 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -