Help needed for preg_replace.
Hello all,
Original text is:
Are you a teacher?????????????????????
No: I am not!!!!!!!!!!!!!
I want to able to make it like this:
Are you a teacher?
No: I am not!
I want to remove some characters if they are more than certain number.
I tried this but did not work
Thanks
Hello all,
Original text is:
Are you a teacher?????????????????????
No: I am not!!!!!!!!!!!!!
I want to able to make it like this:
Are you a teacher?
No: I am not!
I want to remove some characters if they are more than certain number.
I tried this but did not work
PHP:
$pattern = array('/&+/','/\?+/','/#+/','/!+/');
$values = array('&','?','#','!');
$description = preg_replace($pattern, $values, $description);
Thanks







