Tools, FAQ, Tutorials:
Counting the Number of Values in an Array in PHP
How To Get the Total Number of Values in an Array in PHP?
✍: 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().
⇒ Verifying If a Key Exists in an Array in PHP
⇐ PHP Built-in Functions for Arrays
2017-01-29, ∼2614🔥, 0💬
Popular Posts:
How to install .NET Framework in Visual Studio Community 2017? I have the Visual Studio Installer in...
Where can I download the EPUB 2.0 sample book "The Problems of Philosophy" by Lewis Theme? You can f...
Where to find tutorials on OpenID? Here is a large collection of tutorials to answer many frequently...
How to use the "return-response" Policy statement to build the response from scratch for an Azure AP...
How to use the XML to JSON Conversion Tool at freeformatter.com? If you want to try the XML to JSON ...