The `implode` function in PHP joins array elements into a single string using a specified separator, while the `explode` function splits a string into an array based on a specified delimiter.
The implode() function takes an already existing array as
it's argument, and concatenates the contents of
each element in the array into a string.
where as explode() function performs reverse to implode()
function. It splits the string into items by a
delimiter, such as a dash, ampersand, space and places each
item into a new array.
explode function:-it breaks a string into array.
<?php
$str="hello world.it's a beautiful day.":
print_r(explode(" ",$str):
?>
ans-ARRAY
[0]=>hello
[1]=>world.
[2]=>it's
[3]=>a
[4]=>beautiful
[5]=>day.
implode:-returns a string from elements of an array.
<?php
$arr=array('hello','world!',beautiful,'day!');
echo implode(" ",$arr);
?>
ans-hello world! beautiful day!