I have a JSON Array that needs to be searched:
[
{
"Device_ID":"1",
"Image":"HTC-One-X.png",
"Manufacturer":"HTC",
"Model":"One X",
"Region":"GSM",
"Type":"Phone"
},
{
"Device_ID":"2",
"Image":"Motorola-Xoom.png",
"Manufacturer":"Motorola",
"Model":"Xoom",
"Region":"CDMA",
"Type":"Tablet"
},
{
"Device_ID":"8",
"Image":"null",
"Manufacturer":"Motorola",
"Model":"Xoom 2",
"Region":"CDMA",
"Type":"Tablet"
}
]
Using the keyword: $_GET['keyword'];
I need to be able to search the combined value of Manufacturer and Model, for example Motorola Xoom. Then, output the matching values to variables.
For instance, if the Keyword was HTC, it would output:
$DeviceID = 1 $Image = HTC-One-X.png $Manufacturer = HTC $Model = One X $Region = GSM $Type = Phone
If the keyword was Motorola, then all entries containing Motorola should be displayed.
The goal is to show live updates of JSON Array entries as the user types keywords, but run this on the user's computer to reduce server load.
Any suggestions on the best way to accomplish this?