I've got a JSON Array that I need to search:
[
{
"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 do the following.
Search the combined value of Manufacturer and Model, ie. Motorola Xoom. Then, for whichever set of values matches this, output them to variables.
For example: If the Keyword was HTC, then it would search the array and output:
$DeviceID = 1 $Image = HTC-One-X.png $Manufacturer = HTC $Model = One
X $Region = GSM $Type = Type
However if the keyword was Motorola, then it would need to output all entries that include Motorola.
What im trying to do, is output a live view of all JSON Array entries, as the user types the keyword. However I want this to run on the users computer to reduce the load on the server.
Does anyone know the best way to go about this?
Manufacturerproperty. I also don't see how this problem is related to JSON apart from the fact that you get the data as JSON (but you don't seems to have a problem with JSON).