PHP implode() Function

The implode() function returns a string from the elements of an array.

Syntax

implode(separator,array)

Example

<?php

$arr1 = array(
              'The',
		'quick',
		'brown',
		'red',
		'fox',
		'jumps',
		'over',
		'the',
		'lazy',
		'dog'			  
		);

$string = implode(" ",$arr1);
			
echo $string;
?> 

Output

The quick brown red fox jumps over the lazy dog