Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| info:myphp:array [2026/03/05 08:47] – radeff | info:myphp:array [2026/03/05 09:49] (Version actuelle) – radeff | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== PHP Arrays ====== | ====== PHP Arrays ====== | ||
| + | ===== explode ===== | ||
| + | |||
| + | < | ||
| + | <?php | ||
| + | $pizza = " | ||
| + | $pieces = explode(" | ||
| + | |||
| + | |||
| + | for($i=0; | ||
| + | print(" | ||
| + | } | ||
| + | echo "< | ||
| + | show_source(" | ||
| + | ?> | ||
| + | </ | ||
| ===== 1 dimension ===== | ===== 1 dimension ===== | ||
| Ligne 197: | Ligne 212: | ||
| </ | </ | ||
| + | ===== array_splitter ===== | ||
| + | < | ||
| + | <? | ||
| + | function array_splitter($delimiter, | ||
| + | { | ||
| + | $array = explode($delimiter, | ||
| + | #returns the number of elements in the array | ||
| + | $size=count($array); | ||
| + | |||
| + | for ($i=0; $i <= $size; $i++) | ||
| + | echo $array[$i] . "< | ||
| + | |||
| + | } | ||
| + | #Laurent Gottardo, 15.9.04 | ||
| + | ?> | ||
| + | |||
| + | </ | ||