Jump to content

!is_int


salihk.

Recommended Posts

Hello everyone,

I have no well knowledge about php coding.

I am trying to write simple php code for take some datas from mysql. My problem is  whhen i try to control my values that i take from get html with get command.

 

if(!is_int($_REQUEST["num"])

die('It is not integer');

 

When i put integer to num variable for example 2 it prints It is not integer.

Maybe i misunderstand the "!" think.

Could you help me to figure out

Thanks

 

Link to comment
Share on other sites

But in order to check the function is_int() works or not i assigned the num value to a variable

$num=$_REQUEST["num"] and add an integer

$num=$_REQUEST["num"] +1; so it is output was correct

 

than i put it to

if(is_not($num))

die('it is integer');

it prints it is integer

 

than change the code to

 

if(!is_not($num))

die('it is not integer');

and the result is the same it prints again  :-\

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.