Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Test If a Variable Is an Array
How To Test If a Variable Is an Array? - PHP Script Tips - Understanding PHP Arrays and Their Basic Operations
✍: FYIcenter.com
Testing if a variable is an array is easy. Just use the is_array() function. Here is a PHP script on how to use is_array():
<?php $var = array(0,0,7); print("Test 1: ". is_array($var)."\n"); $var = array(); print("Test 2: ". is_array($var)."\n"); $var = 1800; print("Test 3: ". is_array($var)."\n"); $var = true; print("Test 4: ". is_array($var)."\n"); $var = null; print("Test 5: ". is_array($var)."\n"); $var = "PHP"; print("Test 6: ". is_array($var)."\n"); print("\n"); ?>
This script will print:
Test 1: 1 Test 2: 1 Test 3: Test 4: Test 5: Test 6:
2007-04-20, 4940👍, 0💬
Popular Posts:
What is the difference between Session State and ViewState? ViewState is specific to a page in a ses...
What's the difference between J2SDK 1.5 and J2SDK 5.0? There is no difference, Sun Microsystems just...
What are the different accessibility levels defined in .NET ? Following are the five levels of acces...
How can JavaScript make a Web site easier to use? That is, are there certain JavaScript techniques t...
How To Create an Add-to-Bloglines Button on Your Website? - RSS FAQs - Adding Your Feeds to RSS News...