1 2 3 4 5 6 7
<?php $mydob = "01/04/1990"; // Setting the DOB variable $dob = explode("/", $mydob); // Splits the data using the delimiter which in this case is a "/" $day = $dob[0]; // The first in the series is the day of birth $month = $dob[1]; // Second is the month $year = $dob[2]; // Third is the year of birth ?>
1 2 3 4 5
<?php $data = "DanielXP:mYPaSS:daniel@somesite.com"; // The data we wish to split using the explode function. In this example this is a username, password and email. The delimiter being a ":" list($username, $password, $email) = explode(":", $data); // This splits the data by the delimiter and the list functions assigns them to the defined variables. echo "Welcome ".$username." - You email is ".$email; ?>