While working with the php programming language, This article will help you to split comma, colon or any other delimited string in to array.
Use php explode function to split delimited string to array.
$myArray =explode( ',', $myString) ;
Example
Create a php script file and use following code. This example code is using command (,) as delimiter. You can also use any other delimiter like colon (:), semi colon (;), slash (/) etc.
1 2 3 4 5 6 7 8 | <?php $myArray = explode(',', $myString); echo "<pre>"; print_r($myArray); ?> |
Now access file in web browser and you will get following result.
Output:
Array ( [0] => 101 [1] => TecAdmin [2] => [email protected] [3] => India )