Page 3 of 3

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

:D :D THANKS! :D :D

Posted: Wed Jun 21, 2006 8:40 pm
by tecktalkcm0391
now another question i have this: (its different from the goal of previous codes)

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);


?>
And i get
Warning: eregi_replace() [function.eregi-replace]: REG_EPAREN in /home/Include Content/Badword.php on line 286
that. What wrong?

Posted: Wed Jun 21, 2006 11:16 pm
by aerodromoi
tecktalkcm0391 wrote:now another question i have this: (its different from the goal of previous codes)

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);


?>
And i get
Warning: eregi_replace() [function.eregi-replace]: REG_EPAREN in /home/Include Content/Badword.php on line 286
that. What wrong?
It's telling you to watch out for special characters ;)

cy,
Marc

Posted: Thu Jun 22, 2006 12:07 am
by John Cartwright
you arn't supplying a legitamate pattern.. and what is wrong with str_ireplace()?

Posted: Thu Jun 22, 2006 9:25 am
by tecktalkcm0391
aerodromoi wrote:
tecktalkcm0391 wrote:now another question i have this: (its different from the goal of previous codes)

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);


?>
And i get
Warning: eregi_replace() [function.eregi-replace]: REG_EPAREN in /home/Include Content/Badword.php on line 286
that. What wrong?
It's telling you to watch out for special characters ;)

cy,
Marc

What should I do then a stripslashes(); or something?

Jcart wrote:you arn't supplying a legitamate pattern.. and what is wrong with str_ireplace()?
Why isn't is a legitamate pattern... and nothing is wrong with str_ireplace now, it was giveing me an error beforfe.

Posted: Thu Jun 22, 2006 9:27 am
by tecktalkcm0391
another question, can I trim and array... would I do an array_map?

Posted: Fri Jun 30, 2006 1:35 pm
by Robert Plank
tecktalkcm0391 wrote:another question, can I trim and array... would I do an array_map?
Yeah,

Code: Select all

$array = array_map("trim", $array);
trims every element in $array.