Jump to content

Archived

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

Mortier

Strip all the numeric characters from a variabele

Recommended Posts

Hello

The topic title says it already, is there an way I can strip off all the numeric charcaters?
I can't find it.

So that : 'blabla78';

would become : 'blabla';

Thanks in advance!

Share this post


Link to post
Share on other sites
I think it is better to user regular expression to prevent using any number from the very beginning instead of allowing numric value then filtering it.

thanks

Share this post


Link to post
Share on other sites
try
[code]$str = 'blabla78';
$str = str_replace(range(0,9), '', $str);
echo $str;[/code]

Share this post


Link to post
Share on other sites

×

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.