ababmxking Posted July 2, 2008 Share Posted July 2, 2008 Ok so I know about the int() function but it "rounds" all money over like 2,159,000,000 down to that number. I need to know if theres something like a bigint() function? Quote Link to comment Share on other sites More sharing options...
trq Posted July 2, 2008 Share Posted July 2, 2008 There is no int() function in php. What are you wanting to do? Quote Link to comment Share on other sites More sharing options...
ababmxking Posted July 2, 2008 Author Share Posted July 2, 2008 im trying to remove any other characters that aren't numbers from a $_POST. $amount = intval($_POST['amount']); or something along them lines. sorry i guess it was intval that i was talking about not int. but it always rounds any number above 2,147,483,647 down to 2,147,483,647. I need something that will remove anything that isnt a number but not have a maximum amount. Quote Link to comment Share on other sites More sharing options...
trq Posted July 2, 2008 Share Posted July 2, 2008 number_format(). Quote Link to comment Share on other sites More sharing options...
ababmxking Posted July 2, 2008 Author Share Posted July 2, 2008 Just tried it and when someone sends say 50bill it changes the amount to like 50 exactly. Im going to read the thing on php.net real quick though edit ok i just read through it, (im not that good with functions) but the way i read it, it adds a comma or decimal every 3 numbers, and since this is going into a database im guessing its cutting off everything after the first comma. Quote Link to comment Share on other sites More sharing options...
ababmxking Posted July 2, 2008 Author Share Posted July 2, 2008 Could i use ereg() somehow. like $amount = $_POST['amount']; if (ereg('[^A-Za-z0-9]', $amount)) { echo"You can only use numbers in the amount field!"; } else{ echo"Money transfered"; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.