1 $str = "Hello, kinjal, how, are, you";
2
3 // it will convert string to array
4 $s1 = explode(",", $str);
5 echo "<pre>";
6 print_r($s1);
1<html>
2<body bgcolor="pink">
3<h3>Implode Function</h3>
4<?php
5$arr=array ('I','am','simple','boy!');
6echo implode(" ",$arr);
7$str="I am simple boy!";
8print_r(explode(" ",$str));
9?>
10</body>
11</html>
1$arr = ['Thor','Captain America','Iron Man'];
2echo implode(', ',$arr);
3// "Thor, Captain America, Iron Man"
1<?php
2$str = "Hello world. It's a beautiful day.";
3$split = explode(" ",$str);
4$hello = $split[0];
5$world = $split[1];
6?>