Re: How can I change ? to %3F

From: Date: Tue, 05 Aug 2003 22:49:48 +0000
Subject: Re: How can I change ? to %3F
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-158369@lists.php.net to get a copy of this message
David Nicholson wrote:
If you want *only* the ?:&/ characters changed then it can be done with a regular rexpression, the e modifier, and the ord(), hex() and strtoupper() functions, post back if you would like an example.
$new_str = str_replace(array('?',':','&','/'),array('3F','3A','26','2F'),$old_string); should be less costly than a regular expression with an 'e' modifier. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals – www.phparch.com

« previous php.general (#158369) next »