Possible Duplicate:
Text file lines into array with PHP
How can I replace this
$streams = array(
"name1",
"name2",
"name3",
"name4",
"name5",
"name6",
);
with something like
$streams = array(
streams.txt
);
where streams.txt includes
"name1",
"name2",
"name3",
"name4",
"name5",
"name6",
Basically what the whole code does is that it reads from that array those names, and checks on justin.tv if the streams are online. Heres all of the code where I tried to fix it.
<?
$chan = "";
$streams = file('streams.txt');
echo "Live User Streams: ";
foreach ($streams as &$i) {
$chan = "http://api.justin.tv/api/stream/list.json?channel=" . $i;
$json = file_get_contents($chan);
$exist = strpos($json, 'name');
if($exist) {
echo "$i http://twitch.tv/" . $i . " | ";
}
}
echo "";
?>