Recherche dans les tableaux en PHP
in_arrayarray_searchЗадание 1
Soit le tableau :
php<?php
$arr = [1, 2, 3, 4, 5];
?>
Vérifiez qu'il contient un élément avec la valeur
3.
Задание 2
Soit le tableau :
php<?php
$arr = ['a', '-', 'b', '-', 'c', '-', 'd'];
?>
Trouvez la position du premier élément '-'.
Задание 3
Soit le tableau :
php<?php
$arr = ['a', '-', 'b', '-', 'c', '-', 'd'];
?>
Trouvez la position du premier élément '-'
et supprimez-le à l'aide de la fonction array_splice.