php.js : is_array() function

is_array() function

The is_array() function is used to check whether a variable is an array or not. The function returns true if the variable is an array otherwise false.






Name Description Required /
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_array() function:

In the following web document is_array() function test whether a variable is an array or not.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>php.js : is_array() function example</title>
<script type="text/javascript" src="../../phpjs/variable/variable.min.js"> </script>
<h1 style="color: green">php.js : is_array() function example</h1>
<h3>Test whether a variable is an array or not.</h3>
<hr />
<script type="text/javascript">
//This is done to make the following JavaScript code compatible to XHTML. <![CDATA[
var_name=new Array('A','B','C');
if (is_array(var_name))
document.write('This is an array....');
document.write('This is not an array....');

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

Download phpjs.zip

Previous: php.js : intval() function
Next: php.js : is_bool() function

Follow us on Facebook and Twitter for latest update.

We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook