How can I check if the Content-type of a POST request in PHP is either application/json or application/x-www-form-urlencoded?
I've tried using $_SERVER["CONTENT_TYPE"] and echo get_headers('url', 1)["Content-Type"] but neither of those work for me.
$_SERVER["CONTENT_TYPE"]must work