Comment puis-je récupérer les index de tableau dans une boucle foreach?

Comment puis-je obtenir de l'index actuel dans un foreach boucle?

foreach ($arr as $key => $val)
{
    //How do I get the index?
    //How do I get the first element in an associative array?
}
  • $key EST l'indice actuel.
InformationsquelleAutor lovespring | 2009-09-20