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"); $text = str_replace("girl", "guy", "$text"); $text = str_replace("woman", "man", "$text"); $text = str_replace("plant", "tree", "$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); Also, off topic, Anybody else getting a non delivery message from: MAILER-DAEMON@ rotonet.rsdb.nl Thanks, Mag ===== ------ - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php