How to use implode() and explode() in PHP?
explode() function breaks a string into an array, but the implode() function returns a series from the elements of an array.
Example :
$arr = array("1","2","3","4","5");
$str = implode("-",$arr);
OUTPUT
1-2-3-4-5
$array2 = "My name is umesh";
$a = explode(" ",$array2 );
print_r ($a);
OUTPUT
$a = Array ("My", "name", "is", "umesh");
Also Read: Important array functions used in PHP
BY Best Interview Question ON 06 Jul 2020