Given an array:
$arr = array('item1', 'item2', 'item3');
How can I implode this into a string that looks like:
'item1', 'item2', 'item3'
Note the single quotes in above output are important. I realise I can do this using a foreach but am wondering if there is a more elegant way similar to implode and join that can do this in a single function. I can only seem to implode the array into a CSV list without the single quotes:
echo implode(',', $arr);
//outputs
item1, item2, item3