Jump to content

[SOLVED] int() function


Recommended Posts

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
Share on other sites

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




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
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.