Explode in PHP

It takes array and splitted into strings.In the given example we have taken an array of states.by using explode(),spilitted into a single string.

Source code :

<?php
$states="Tamilnadu,Kerala,AndhraPradesh,Andaman,Bihar";
$state=explode(",",$states);
echo $state[0],$state[1],$state[2],$state[3],$state[4];
?>

Output :

TamilnaduKeralaAndhraPradeshAndamanBihar

Output :


                

Comments :