From f0568677de0030e667af88ed104eb79516365231 Mon Sep 17 00:00:00 2001 From: Daniel Beckham Date: Wed, 20 Jun 2001 14:26:02 +0000 Subject: [PATCH] - more clarification of count (and sizeof) - linkage to the Arrays sub-section of the Types section no one seems to be able to find that section so they can RTFM git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@49875 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/array.xml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/functions/array.xml b/functions/array.xml index 2aa64ee374..4e3cffc9bf 100644 --- a/functions/array.xml +++ b/functions/array.xml @@ -13,6 +13,11 @@ There are specific database handling functions for populating arrays from database queries, and several functions return arrays. + + Please see the Arrays + section of the manual for a detailed explanation of how arrays are + implemented and used in PHP. + See also is_array, explode, implode, split @@ -1781,7 +1786,7 @@ $result = compact ("event", "nothing_here", $location_vars); Returns 1 if the variable is not an array. - Returns 0 if the variable is not set. + Returns 0 if the variable is not set or is an empty array. Count may return 0 for a variable that @@ -1791,6 +1796,11 @@ $result = compact ("event", "nothing_here", $location_vars); + + Please see the Arrays + section of the manual for a detailed explanation of how arrays are + implemented and used in PHP. + <function>Count</function> example @@ -1799,10 +1809,22 @@ $a[0] = 1; $a[1] = 3; $a[2] = 5; $result = count ($a); -//$result == 3 +// $result == 3 + +$b[0] = 7; +$b[5] = 9; +$b[10] = 11; +$result = count ($b); +// $result == 3; + + + The sizeof function is an alias for + count. + + See also: sizeof, isset, and