I have an object array which has key values
Array ( [0] =>stdClass Object ( [privacy] => {"name": "on", "email": null, "mobile": null, "address": "on", "alt_contact": "on"} ) )
I need to print a string which will contain the comma separated keys which has values as 'on'. The resultant string should be
$result = "name,address,alt_contact";
Please help