w3resource

php.js : is_long() function

is_long() function

The is_long() function is used to check whether a variable is a long (integer) or not. The function returns true if the variable is a long (integer) otherwise false.

Version:

1103.1210

Syntax:

is_long(var_name)

Parameters:

Name Description Required /
Optional
Type
var_name The variable being checked Required Mixed*

*Mixed : Mixed indicates that a parameter may accept multiple (but not necessarily all) types.

Example of php.js is_long() function:

In the following web document is_long() function test whether a variable is long or not.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>php.js : is_long() function example</title>
<script type="text/javascript" src="../../phpjs/variable/variable.min.js"> </script>
</head>
<body>
<h1 style="color: green">php.js : is_long() function example</h1>
<h3>Returns true if value is a long (integer).</h3>
<hr />
<script type="text/javascript">
//This is done to make the following JavaScript code compatible to XHTML. <![CDATA[
var_name1=678;
var_name2=698.99;
var_name3=+125689.66;
result=is_long(var_name1);
document.write("678 is long number? ")+var_dump(result);
document.write("<br />");
result=is_long(var_name2);
document.write("698.99 is long number? ")+var_dump(result);
result=is_long(var_name3);
document.write("<br />");
document.write("125689.66 is long number? ")+var_dump(result);
//]]>
</script>
</body>
</html>

Output of the function:

678 is long number?
bool(false)
698.99 is long number?
bool(true)
125689.66 is long number? 
bool(true)

View example of php.js is_long() function in browser

Download phpjs.zip

Previous: php.js : is_integer() function
Next: php.js : is_null() function



Follow us on Facebook and Twitter for latest update.