View Single Post
  #1 (permalink)  
Old 02-28-2008, 09:56 AM
kruser kruser is offline
WebProWorld Pro
 

Join Date: Aug 2007
Location: Southern Illinois USA
Posts: 146
kruser RepRank 0
Default PHP allow only numbers in string

Hello,

I am looking for a way to only allow the numbers 0-9 in a string. I would like to remove any other characters.

Example: $string="$1,234 Tom";
would like to script to make $string="1234";

I once saw someone do this as a sucurity measure, but can't find it.
__________________
Best Regards,
Randy
Reply With Quote