Set Header JSON in PHP

<?php 

$product = array(
    'id' => 'p01',
    'name' => 'name 1',
    'price' => 4.5
);

header('Content-Type: application/json');
echo json_encode($product);

?>       
    
{"id":"p01","name":"name 1","price":4.5}