php implode array
snippet in php

php implode array

user1145

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

php implode

user8826

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

php implode

user3889

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

join array of strings php

user9965

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

php glue strings

user6444


<?php
$a = "Hello ";
$b = $a . "World!"; // now $b contains "Hello World!"

$a = "Hello ";
$a .= "World!";     // now $a contains "Hello World!"
?>