[Resolved] Help needed for preg_replace.

SpaceshipSpaceship
Watch

baris22

Established Member
Impact
1
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

PHP:
$pattern     = array('/&+/','/\?+/','/#+/','/!+/'); 
$values     = array('&','?','#','!'); 
$description = preg_replace($pattern, $values, $description);

Thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
works 100% for me.
 
0
•••
Appraise.net

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy — Payment Flexibility
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back