Joining Array Elements into a String in PHP


Join array elements into a string with a delimiter using implode().

Source Code

$array = ['Hello', 'World', 'PHP'];
$string = implode(" ", $array);
echo $string; // Outputs: Hello World PHP
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments