1
2<?php
3// Exemple 1
4$pizza = "piece1 piece2 piece3 piece4 piece5 piece6";
5$pieces = explode(" ", $pizza);
6echo $pieces[0]; // piece1
7echo $pieces[1]; // piece2
8
9// Exemple 2
10$data = "foo:*:1023:1000::/home/foo:/bin/sh";
11list($user, $pass, $uid, $gid, $gecos, $home, $shell) = explode(":", $data);
12echo $user; // foo
13echo $pass; // *
14
15?>
16
17
1
2<?php
3// Exemple 1
4$pizza = "piece1, piece2, piece3, piece4, piece5, piece6";
5$pieces = explode(" ", $pizza);
6echo $pieces[0]; // piece1
7echo $pieces[1]; // piece2
8
9// Exemple 2
10$data = "foo:*:1023:1000::/home/foo:/bin/sh";
11list($user, $pass, $uid, $gid, $gecos, $home, $shell) = explode(":", $data);
12echo $user; // foo
13echo $pass; // *
14
15?>
16
17