A

Admin • 828.03K Points
Coach

Q. Which PHP function outputs JSON with correct headers?

  • (A) echo json_encode()
  • (B) print json_encode()
  • (C) header('Content-Type: application/json')
  • (D) Both 1 and 3
  • Correct Answer - Option(D)
  • Views: 2
  • Filed under category PHP
  • Hashtags:

Explanation by: Admin
Header + json_encode ensures proper JSON response.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.