Implode()
It is a string function which returns the Join array elements as a string.
The Implode() returns a string with elements of array arranged in a string in the same order.
example:
<?php
$str = array('Hello','World!','Good','Morning!');
echo implode(" ",$str);
?>
output
Hello World! Good Morning!
explode()
It is a string function which splits a string by string. It breaks a string in an array.
we can provide a delimiter in the function which tells how to split the string.
example:
<?php
$str = "Hello world! Good Morning!";
print_r (explode(" ",$str));
?>
output
Array ( [0] =>; Hello [1] =>; world. [2] =>; Good [3] =>; Morrning )
0 Comment(s)