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
Post a Comment