Skip to content

Instantly share code, notes, and snippets.

@peterfox
Last active May 17, 2018 12:28
<?php
$name = 'Jimmy';
$verb = 'eat';
$item = 'apples';
$count = '3';
$period = 'day';
$array = [
$name,
'would',
$verb,
$item,
'up to',
$count,
'times a',
$period,
];
$string = implode(' ', $array);
// Produces the string 'Jimmy would eat apples up to 3 times a day
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment