I am trying to find a function that will strip comma's out of an integer. Most of the data entered into the field is over 1000, so most people would be inclined to put a comma in the appropriate place, so I was wondering if anybody could help me figure out what function would strip those commas out before entering it into the DB.
Thanks! --Lisa
I wish I knew Lisa. I'm trying to put comma's IN mine! Maybe we can work this out togeather!
well, i know the number_format() function will work to put comma's in appropriately, like if you had 58696 it'd make it 58,696 instead. Hope that helps!
Take care! --Lisa
Thanks! I'll try it and let you know.
To remove them you could try this. preg_replace("/\D/","",$var); //remove non-digits
Try function preg_replace () will do what you want (untested code follows):
$no_comma_string = preg_replace ("/,/", "", $string_with_commas);
Thanks for the help, guys! I'll Let you know!
Thanks guys! The function you suggested worked like a dream! I really appreciate all your help!
Tace care! --Lisa