implode php
snippet in php

php array to string

user6856


<?php

$arr = array('Hello','World!','Beautiful','Day!');

echo implode(" ",$arr);

?> 

implode php

user2478

$array = array('banana', 'strawberry', 'apple');
comma_separated  = implode(",", $array);
echo comma_separated; // banana,strawberry,apple

php implode array

user765

$values = array_map('array_pop', $array);
$imploded = implode(',', $values);

implode in php

user8449

<?php
$arr = array('Hello','World!','Beautiful','Day!');
echo implode(" ",$arr);
?> 

php implode

user891

$arr = array('Hello','World!','Beautiful','Day!');
echo implode(" ",$arr);
// Outputs: 'Hello World! Beautiful Day!'

php implode

user8859

$colors = array("red","blue","green");
$colorsCSV= "'".implode("','",$colors)."'";
//$colorsCSV: 'red','blue','green'