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? Link to comment https://forums.phpfreaks.com/topic/112875-solved-int-function/ 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? Link to comment https://forums.phpfreaks.com/topic/112875-solved-int-function/#findComment-579756 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. Link to comment https://forums.phpfreaks.com/topic/112875-solved-int-function/#findComment-579762 Share on other sites More sharing options...
trq Posted July 2, 2008 Share Posted July 2, 2008 number_format(). Link to comment https://forums.phpfreaks.com/topic/112875-solved-int-function/#findComment-579769 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. Link to comment https://forums.phpfreaks.com/topic/112875-solved-int-function/#findComment-579772 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"; } Link to comment https://forums.phpfreaks.com/topic/112875-solved-int-function/#findComment-579804 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.