Re[2]: [PHP4BETA] count($array,1) or count($array)

[email protected]
Newsgroups php.version4
Message-ID <[email protected]>
Hello Cynic,

Monday, May 22, 2000, 5:58:03 AM, you wrote:

C> I don't understand what you ask about. Can you rephrase your 
C> question?

C> -------------------------------------------------------------- 
>>Hello ,
>>
>>   I never see count($array,1) in doc, but someone to use it.
>>   count($array) unlikeness count($array) ??
>>
>>   Thanks fou you help!
>>

 At http://www.zend.com/tips/tips.php?id=18&single=1 have this code:
############################################
<?
function uniqueArray($array)  
{ 
 // Get unique elts as keys in assoc. array 
 for ($i=0,$n=count($array, 1);$i<$n;$i++) 
     $u_array[$array[$i]] = 1; 

 // Copy keys only into another array 
 reset($u_array, 1); 
 for ($i=0,$n=count($u_array, 1);$i<$n;$i++) { 
     $unduplicated_array[] = key($u_array, 1); 
     next($u_array, 1); 
 } 
 return $unduplicated_array; 
} 
?>
############################################

At php4 doc function count():
############################################
count -- count elements in a variable
Description

int count(mixed var);

Returns the number of elements in var, which is typically an array (since anything else will have one element).

Returns 1 if the variable is not an array.

Returns 0 if the variable is not set. 
###########################################

The "count($u_array, 1)" and "count($u_array)" is what mean ?

I am sorry for my english so poor !
-- 
Best regards,
 php                            mailto:[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.