We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


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.