json_decode takes a string as an argument. Read in file with file_get_contents
$json_data = file_get_contents('data.txt'); json_decode($json_data, true);
You need to tweak the pattern string to be valid JSON by adding quotes around strings, commas between objects, and placing objects in a containing array (or object).
[{"name":"yekky"}, {"name":"mussie"}, {"name":"jessecasicas"}]
source share