Manuel PHP

Précédent

 

Suivant

array_pop

array_pop -- Dépile un élément de la fin díun tableau

Description

mixed array_pop(array array);

array_pop() dépile et retourne le dernier élément du tableau array, le raccourcissant díun élément.

Exemple 1. exemple array_pop()

$stack = array("orange", "pomme", "framboise");
$fruit = array_pop($stack);
      

Après cette opération, $stack nía plus que deux éléments: "orange" et "pomme", et $fruit contient "framboise".

Voir aussi array_push(), array_shift(),et array_unshift().

Note: Cette fonction a été ajoutée dans PHP 4.0.

Précédent

Sommaire

Suivant

array_push

Chapitre

array_unshift