array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'function.is-array.php', 1 => 'is_array', ), 'up' => array ( 0 => 'ref.var.php', 1 => 'Fonctions de gestion des variables', ), 'prev' => array ( 0 => 'function.intval.php', 1 => 'intval', ), 'next' => array ( 0 => 'function.is-bool.php', 1 => 'is_bool', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/var/functions/is-array.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
is_array — Détermine si une variable est un tableau
value
La variable à évaluer.
Exemple #1 Exemple avec is_array()
<?php
$yes = array('ceci', 'est', 'un tableau');
echo is_array($yes) ? 'Tableau' : 'ce n\'est pas un tableau';
echo "\n";
$no = 'ceci est une chaîne';
echo is_array($no) ? 'Tableau' : 'ce n\'est pas un tableau';
?>
L'exemple ci-dessus va afficher :
Tableau ce n'est pas un tableau