Jump to content

[SOLVED] preg replace


ted_chou12

Recommended Posts

Are you looking to replace them all, no matter where they are? If so:

 

preg_replace("[0-9]","test",$number); should do it, however that replaces each digit with test.

 

preg_replace("[0-9]*","test",$number); will replace them all, however each bit of numbers will be replaced by test, i.e. 333 becomes test, 33a33 becomes testatest, etc.

Link to comment
https://forums.phpfreaks.com/topic/37462-solved-preg-replace/#findComment-179120
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.