Jump to content

[SOLVED] is_int() function?


thefollower

Recommended Posts

When can this ever be used in php? Because when i input 10 in a input box im assuming php takes it as a string of two chars which is 1 and 0 rather than the number 10 which would explain why my is_int() function check fails when it checks if the input is an integer... so what can i do to check the number is a nice integer?

 

This is what i put:

<?php
$Price = mysql_real_escape_string($_POST['Price']);
If($Price < 1 OR !(is_numeric($Price)) OR !(is_numeric($Tokens2))
OR !(is_int($Price))){
?>
Price must be greater than zero!</span>
<br>
<a href="test.php">Back</a>
<?
}
?>

Link to comment
https://forums.phpfreaks.com/topic/123952-solved-is_int-function/
Share on other sites

Archived

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.