CakeFest 2024: The Official CakePHP Conference

SplFixedArray::toArray

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

SplFixedArray::toArrayRetourne un tableau PHP à partir d'un tableau à taille fixe

Description

public SplFixedArray::toArray(): array

Retourne un tableau PHP à partir d'un tableau à taille fixe.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Retourne un tableau PHP à partir d'un tableau à taille fixe.

Exemples

Exemple #1 Exemple avec SplFixedArray::toArray()

<?php
$fa
= new SplFixedArray(3);
$fa[0] = 0;
$fa[2] = 2;
var_dump($fa->toArray());
?>

L'exemple ci-dessus va afficher :

array(3) {
  [0]=>
  int(0)
  [1]=>
  NULL
  [2]=>
  int(2)
}

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top