PHP implodieren
$arr = array('Hello','World!','Beautiful','Day!');
echo implode(" ",$arr);
// Outputs: 'Hello World! Beautiful Day!'
Dangerous Dove
$arr = array('Hello','World!','Beautiful','Day!');
echo implode(" ",$arr);
// Outputs: 'Hello World! Beautiful Day!'
$values = array_map('array_pop', $array);
$imploded = implode(',', $values);
$colors = array("red","blue","green");
$colorsCSV= "'".implode("','",$colors)."'";
//$colorsCSV: 'red','blue','green'
<?php
$array = ['Waiting', 'for', 'Avenger', 'End', 'Game'];
echo implode(" ",$array); // Result: Waiting for Avenger End Game
?>
<?php
$array = ['A', 'v', 'e', 'n', 'g', 'e', 'r'];
echo implode($array); // Avenger
?>
<?php
$array = [1, false, 0, true, NULL, 0.07];
echo implode(', ', $array); // 1, , 0, 1, , 0.07
?>
<?php
$movies = [
'comedy' => ['In the Loop', '21 Jump Street', 'Elf ', 'This Is the End'],
'war' => ['Dunkirk', 'Hacksaw Ridge', 'Inglourious Basterds', 'Defiance'],
'action' => ['La La Land', 'The Notebook', 'About Time', 'Twilight'],
'sci fi' => ['Interstellar', 'Annihilation', 'Gravity', 'Inception'],
];
echo implode(', ', $movies); // Array, Array, Array, Array
?>