PHP implode and explode functions

PHP implode() function is used to join array elements with a string.

This function can be used whenever you want to represent an array in the form of string separated by some or any delimiter.

Example:

OUTPUT:
orange, grapes, banana, apple

 
PHP explode() function is used to fetch or get an array of elements from a string separated by some delimiter.

Example:

OUTPUT:
orange
grapes