Javascript is_integer : Variable handling : PHP functions in JavaScript JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » PHP functions in JavaScript » Variable handling »

 

Javascript is_integer


Example 1

Running
1.is_integer(186.31);

Could return
1.false
Example 2

Running
1.is_integer(12);

Could return
1.true
function is_integer( mixed_var ) {
    // !No description available for is_integer. @php.js developers: Please update the function summary text file.
    // 
    // version: 812.1017
    // discuss at: http://phpjs.org/functions/is_integer
    // +   original by: Paulo Ricardo F. Santos
    //  -   depends on: is_int
    // %        note 1: 1.0 is simplified to 1 before it can be accessed by the function, this makes
    // %        note 1: it different from the PHP implementation. We can't fix this unfortunately.
    // *     example 1: is_integer(186.31);
    // *     returns 1: false
    // *     example 2: is_integer(12);
    // *     returns 2: true
    return is_int(mixed_var);
}


HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo PHP functions in JavaScript
» Variable handling