Return to Snippet

Revision: 4328
at November 27, 2007 13:24 by nicolaspar


Initial Code
function keepqsSinParametro($parametro, $keepqs = ''){
	if( empty($keepqs) ) global $keepqs;
	$keepqs = urldecode($keepqs);
	return preg_replace('/[\&\?]?'.$parametro.'=[^\&]*/','', $keepqs);
}

Initial URL

                                

Initial Description
ej: 
echo keepqsSinParametro('hola','hola=mundo&mundo=lindo&hola=chau'); #out = mundo=lindo

Initial Title
PHP - Sacar Parametro de "string tipo QS"

Initial Tags
url

Initial Language
PHP