above solution is giving syntax error , also I have tried
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"type":"channel.follow","version":"1","condition":{"broadcaster_user_id":"'.intval($oAuth['data'][0]['id']).'"},"transport":{"method":"webhook","callback":"---","secret":"'.$secret.'"}}');
this also gives error → The value specified in the method field is not valid
I think this error is regarding with the method in the parameters we are sending