Skip to content

Commit

Permalink
New: added array_quote()
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartherbert committed May 11, 2018
1 parent ce26e9d commit 2033bec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/array-functions.php
Expand Up @@ -167,4 +167,9 @@ function array_filter_contents(array $target, array $filterMap)
}

return $retval;
}

function array_quote(array $data, string $separator = ',', string $quote = '"')
{
return $quote . implode($quote . $separator . $quote, $data) . $quote;
}

0 comments on commit 2033bec

Please sign in to comment.