* Thus wrote PHP Gen: > Hi, > I need to use a couple of str_replace's in one of my > programs and would like to know which is more resource > friendly: > > 1) having multiple str_replace one after another > > eg: > $text = str_replace("orange", "apple", "$text"); > $text = str_replace("black", "white", "$text"); > ... > > 2) by using an array > > eg: > $bad = array("orange", "black", "girl", "woman", > "plant"); > $good = array("apple", "white", "guy", "man", "tree"); > $text = str_replace($bad, $good, $text);
#2 Anytime you can have the internals of php handle stuff for you the better it most likely will be. > > > Also, off topic, > Anybody else getting a non delivery message from: > MAILER-DAEMON@ rotonet.rsdb.nl I'll see what I can do about this. thanks for reminding me :) Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php