Posted By

nicolaspar on 11/27/07


Tagged

url delete String parameter parser cut


Versions (?)

PHP - Sacar Parametro de "string tipo QS"


 / Published in: PHP
 

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

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

Report this snippet  

You need to login to post a comment.