PHP Program to convert an array to a string

bookmark

<?php
$favouriteColors = array("Red", "Yellow", "Blue");
$string = join(',', $ favouriteColors);
echo 'Favourite Colors are: ' . $string;
?>

Output

Favourite Colors are: Red, Yellow, Blue