NameSilo

[Resolved] Help needed for preg_replace.

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
works 100% for me.
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back