Posted By

sveggiani on 01/05/09


Tagged

strings evFunctions


Versions (?)

evRemoveParamURL | removes a parameter of a given URL and returns it


 / Published in: PHP
 

  1. // name: evRemoveParamURL
  2. // version: v0.1
  3. // description: elimina un parametro en una URL
  4.  
  5. function evRemoveParamURL( $url, $key ) {
  6. $url = preg_replace( '/(.*)(\?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&' );
  7. $url = substr( $url, 0, -1 );
  8. return ( $url );
  9. }

Report this snippet  

You need to login to post a comment.