echo implode(",", array_keys($companies->toArray()));
$companies->toArray()
--
this is just in case if your $variable
is an object, otherwise just pass $companies.
That's it!
echo implode(",", array_keys($companies->toArray()));
$companies->toArray()
--
this is just in case if your $variable
is an object, otherwise just pass $companies.
That's it!