RE: [PHP] str_replace question

From: Date: Tue, 09 Sep 2003 21:36:44 +0000
Subject: RE: [PHP] str_replace question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-162112@lists.php.net to get a copy of this message
$String = "<ques99>"; preg_replace('/*\<[a-z]+)[0-9]+(\>)/', '$1$2', $String); will most likeley do. Btw, does anybody know why preg_replace is adviced over ereg_replace in the manual? .. and if ereg_replace doesn't have any advantages over preg_replace, couldn't this function get depricated? -> -----Oorspronkelijk bericht----- -> Van: Al [mailto:news@ridersite.org] -> Verzonden: dinsdag 9 september 2003 23:21 -> Aan: php-general@lists.php.net -> Onderwerp: [PHP] str_replace question -> -> -> I've got a simple expression "<quesxx> where "xx" is a number -> from 0 to 99. -> -> I want to replace it with simply <ques>. That is, I want to remove the -> numbers. -> -> Will "str_replace" do it, or must I use ereg_replace? -> -> I haven't figured out from reading the php manual on regular expression -> how to do this simple thing. -> -> Thanks.... -> -> -- -> PHP General Mailing List (http://www.php.net/) -> To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#162112) next »