Jump to content

Display only the numbers in a string


papaface

Recommended Posts

Hello,
Can someone please help me with the code below.
[code]ereg_replace("[[:alpha:]]", "", $string);[/code]
I want to allow ONLY numbers. This means i have to get rid of all special characters aswell such as <%*(£^", so i that i am just left with numbers e.g. 76445 :D

Thanks
Link to comment
https://forums.phpfreaks.com/topic/31683-display-only-the-numbers-in-a-string/
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.