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


JAVASCRIPT TUTORIALS » PHP functions in JavaScript » Variable handling »

 

Javascript is_string


Returns true if variable is a Unicode or binary string
Example 1

Running
1.is_string('23');

Could return
1.true
Example 2

Running
1.is_string(23.5);

Could return
1.false
function is_string( mixed_var ){
    // Returns true if variable is a Unicode or binary string  
    // 
    // version: 810.114
    // discuss at: http://phpjs.org/functions/is_string
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // *     example 1: is_string('23');
    // *     returns 1: true
    // *     example 2: is_string(23.5);
    // *     returns 2: false
    return (typeof( mixed_var ) == 'string');
}


HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo PHP functions in JavaScript
» Variable handling