In Action

The Php split function lets you extract data on a delimiter value. It is easy to user. It is not used very often. When doing this type of operation the implode and explode functions typically get used.



Php Code

Just cut-n-paste to reuse.

$passwd_line = "Foo:bar";
list($user, $pass) =  split(":", $passwd_line, 2);
echo $user;
echo $pass;