Posted: Wed Jun 21, 2006 12:13 am
awsome it works!
THANKS!

A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$text = 'I have a badword here';
$badwords = array();
$badwords[] = array(' badword', ' *!* ');
$badwords[] = array(' \@\$\$ ', ' *!* ');
$badwords[] = array(' a\$\$ ', ' *!* ');
foreach ($badwords as $badword) {
$text = eregi_replace($badword[0],$badword[1],$text);
}
return trim($text);
?>that. What wrong?Warning: eregi_replace() [function.eregi-replace]: REG_EPAREN in /home/Include Content/Badword.php on line 286
It's telling you to watch out for special characterstecktalkcm0391 wrote:now another question i have this: (its different from the goal of previous codes)
And i getCode: Select all
<?php $text = 'I have a badword here'; $badwords = array(); $badwords[] = array(' badword', ' *!* '); $badwords[] = array(' \@\$\$ ', ' *!* '); $badwords[] = array(' a\$\$ ', ' *!* '); foreach ($badwords as $badword) { $text = eregi_replace($badword[0],$badword[1],$text); } return trim($text); ?>that. What wrong?Warning: eregi_replace() [function.eregi-replace]: REG_EPAREN in /home/Include Content/Badword.php on line 286
aerodromoi wrote:It's telling you to watch out for special characterstecktalkcm0391 wrote:now another question i have this: (its different from the goal of previous codes)
And i getCode: Select all
<?php $text = 'I have a badword here'; $badwords = array(); $badwords[] = array(' badword', ' *!* '); $badwords[] = array(' \@\$\$ ', ' *!* '); $badwords[] = array(' a\$\$ ', ' *!* '); foreach ($badwords as $badword) { $text = eregi_replace($badword[0],$badword[1],$text); } return trim($text); ?>that. What wrong?Warning: eregi_replace() [function.eregi-replace]: REG_EPAREN in /home/Include Content/Badword.php on line 286
cy,
Marc
Why isn't is a legitamate pattern... and nothing is wrong with str_ireplace now, it was giveing me an error beforfe.Jcart wrote:you arn't supplying a legitamate pattern.. and what is wrong with str_ireplace()?
Yeah,tecktalkcm0391 wrote:another question, can I trim and array... would I do an array_map?
Code: Select all
$array = array_map("trim", $array);