How can I implode into a quoted string? I would like it to look like this..... 'SHORT','IN STOCK','SHIPPED' . $status is just an array of values SHORT,IN STOCK and SHIPPED.
$statusGroup = implode(",",$status);
<?php $status=array('SHORT','IN STOCK','SHIPPED'); $statusGroup = "'".implode("','",$status)."'"; echo $statusGroup; //'SHORT','IN STOCK','SHIPPED' ?>
Common one-liner to do it would be:
"'" . implode("','", $status) . "'"
though that doesn't protect you from the delimiter (single quote) appearing inside of any of the values.
EDIT: Woops, forgot to refresh before posting.