Important !

Projet-City was created many years ago, in 2001 and is shown here as a demonstration of what I was capable at that time. Please take note that the content of this website is not longer valid. Check out my CV if you're interested to see more modern stuff and also my Portfolio if you're looking for designs.

Projet-City : Technologies du Web
Accueil > Cours php > count()

> count()

  • Auteur : Weber
  • Publi?e : 01/01/2003
  • Mise ?our le : 01/01/2003

La balise count est tr? utilis?et elle permet de (comme son nom l'indique) : compter le nombre d'enregistrements dans un tableau.  
 

Utilisation de la fonction count()

La balise count est toute simple ! Voici sa structure :  
 

count($nom_du_tableau)

Voici un exemple :  
 

count1.php
<?php
    $tableau 
= array( 
                                
"Auteur"=>"Core Design et Eidos"
                                
"Nom"=> "Lara" 
                                
"Pr?om"=> "Croft" 
                                
"Style"=> "Action/Aventure"
                                
"Version"=> "Next G??ation",  
                                
"Note"=> "22/20" 
                                  
); 
     
$compter count($tableau); 
     echo 
'Il y a :'$compter.' enregistrements dans le tableau :$tableau'
?>
R?ultats :
Il y a : 6 enregistrements dans le tableau : $tableau
© 2002 - 2003 Weber Tous droits reserv?
< Cours pr?dent Cours suivant >

D?uvertes

Mozilla Power Mozilla est un regrouppement de plusieurs outils dont : Firefox (navigateur qui respecte les standards) et un système de messagerie (...)

Consulter le site français