This values
//myfile.txt
data:[
{'name': 'Item 1', 'icon': 'snowplow', 'inv': 'B123', 'eh': 'h'},
{'name': 'Item 2', 'icon': 'snowplow', 'inv': 'B456', 'eh': 'h'},
{'name': 'Item 3', 'icon': 'snowplow', 'inv': 'B789', 'eh': 'h'},
{'name': 'Item 4', 'icon': 'snowplow', 'inv': 'B102', 'eh': 'h'}
]
are stored in a *.txt file that I can't change. If i read this textfile with PHP like this:
$fn = fopen("myfile.txt","r");
while(! feof($fn)) {
$result = fgets($fn);
// echo $result[name];
// echo $result[icon];
// echo $result[inv];
// echo $result[eh];
}
fclose($fn);
How can i loop through this values with PHP?