[snip] I currently use number_format() and str_replace() to remove a "," or "$" if entered and reformat it as a price for an item. I've asked the user not to use decimals but some still do. How do I remove a decimal and anything after from a number in a varable? [/snip]
http://www.php.net/explode $dollar = "100.28"; $newDollar = explode(".", $dollar); echo $newDollar[0]; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php