I\'m looking for a fast way to turn an associative array in to a string. Typical structure would be like a URL query string but with customizable separators so I can use \'<
echo implode(",", array_keys($companies->toArray()));
$companies->toArray() -- this is just in case if your $variable is an object, otherwise just pass $companies.
$companies->toArray()
$variable
That's it!