Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 250 Bytes

json_content_type.md

File metadata and controls

12 lines (9 loc) · 250 Bytes

Set content type to JSON

header('Content-Type: application/json');
echo json_encode([]);
  • header - will send header to the client
  • application/json - set JSON content type
  • json_encode([]) - output some JSON

group: content_types