explode php-string to array in php

explode: converts a string into an array.

Syntax
explode(separator,string)

Example:string to array in php

<?php
$str = "A,B,C,D";
print_r (explode(",",$str));
?>


OUTPUT:
Array
(
[0] => A
[1] => B
[2] => C
[3] => D
)