eregi_replace probs

From: Date: Fri, 16 Nov 2001 22:16:14 +0000
Subject: eregi_replace probs
Groups: php.general 
Request: Send a blank email to php-general+get-74938@lists.php.net to get a copy of this message
function scan_string(&$str) { $forbid = array ("coke", "tylenol", "ford"); $swap = array ("pepsi", "advil", "chevrolet"); for ($i = 0; $i < count ($forbid); $i++) { eregi_replace($forbid[$i],$swap[$i],$str); } } I run this script, and I know the array's load up and the for...do loop runs ok. As does the passing variable ($str). I enter a test script such as "I like coke." and my returned value remains "I like coke." It appears the eregi_replace is the problem. Any idea why?

« previous php.general (#74938) next »