You have to return the keys from array with this:
$keys = array_keys($all_meta_for_user);
Afterwards, implode your array to a string (inserting a dot before to create the first class):
$stringedKeys=".".implode(',.', $keys);
And now you have a string of keys that you can use in JS if you like, or insert them from PHP directly.