<?php
$json = json_decode('[
{
"zipcode": 35004,
"state abbreviation": "AL",
"latitude": 33.606379,
"longitude": -86.50249,
"city": "Moody",
"state": "Alabama"
},
{
"zipcode": 35005,
"state abbreviation": "AL",
"latitude": 33.606379,
"longitude": -86.50249,
"city": "Moody",
"state": "Alabama"
}
]');
$zipcode = 35004;
$index = array_search($zipcode, array_column($json, 'zipcode'));
print_r($json[$index]);
preferences:
26.25 ms | 407 KiB | 5 Q