SyntaxFix
Write A Post
Hire A Developer
Questions
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!