Initialiser un élément d'un tableau ?

DuncanIdaho Messages postés 98 Date d'inscription mardi 1 janvier 2002 Statut Membre Dernière intervention 12 février 2008 - 29 avril 2004 à 12:42
yami_no_ookami Messages postés 165 Date d'inscription jeudi 29 janvier 2004 Statut Membre Dernière intervention 16 octobre 2005 - 29 avril 2004 à 15:39
Salut

je voudrais recoder un script avec error_reporting à E_ALL.

Mais j'ai besoin d'utiliser un tableau ou je rajoute des informations un peu n'importe comment ;-) ce qui provoque des erreurs :

Notice: Undefined index: 1 in machin.php

Est-ce qu'il y a un moyen de savoir si un élément du tableau est initialisé ou contient deja qqc ?

merci, @++

Duncan Idaho
http://www.pwsphp.com/

1 réponse

yami_no_ookami Messages postés 165 Date d'inscription jeudi 29 janvier 2004 Statut Membre Dernière intervention 16 octobre 2005 2
29 avril 2004 à 15:39
s'il ne contient il doit etre a null.

donc

is_null($tab[0])

te renvoie vrai s'il ne contient rien.
attention chaine vide "" n'est pas null.
0
Rejoignez-nous