bukwus Posted May 3, 2012 Share Posted May 3, 2012 HiRegarding the number_format() function, is there a way to check, perhaps with an "if else" statement, if the value of a variable which is a number string is formatted? Also, is there a function that strips a number's formatting?Thanks Link to comment Share on other sites More sharing options...
bukwus Posted May 3, 2012 Author Share Posted May 3, 2012 More specifically, can I check to see if a number has commas and, if so, remove the commas? Link to comment Share on other sites More sharing options...
justsomeguy Posted May 3, 2012 Share Posted May 3, 2012 You can use strpos to check if a character is in a string, and use str_replace to replace characters. http://www.php.net/manual/en/function.strpos.phphttp://www.php.net/manual/en/function.str-replace.php Link to comment Share on other sites More sharing options...
bukwus Posted May 3, 2012 Author Share Posted May 3, 2012 Awesome. Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now