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 Get the Total Number of Values in an Array
How To Get the Total Number of Values in an Array? - PHP Script Tips - PHP Built-in Functions for Arrays
✍: FYIcenter.com
You can get the total number of values in an array by using the count() function. Here is a PHP example script:
<?php
$array = array("PHP", "Perl", "Java");
print_r("Size 1: ".count($array)."\n");
$array = array();
print_r("Size 2: ".count($array)."\n");
?>
This script will print:
Size 1: 3 Size 2: 0
Note that count() has an alias called sizeof().
2007-04-20, 5281👍, 0💬
Popular Posts:
What is COCOMO I, COCOMOII and COCOMOIII? In CD we have a complete free PDF tutorial of how to prepa...
Can you explain project life cycle ? Figure :- 12.2 Life cycle of a project There are five stages of...
Can you explain Forms authentication in detail ? In old ASP if you where said to create a login page...
What will be printed as the resultof the operation below: int x; int modifyvalue() { return(x+=10); ...
How To Dump the Contents of a Directory into an Array? - PHP Script Tips - Working with Directoris a...