I'm very new to php and I'm trying to create an unordered list from a text file. I read in the text file "oscars.txt" and then create the unordered list. I believe my logic is correct, but when I host the page, I cannot get anything to show up. It says it cannot load my page. This leads me to believe that something in my syntax is incorrect. Does anyone have any ideas what I have done incorrectly here and how I can go about resolving it? Thanks for any help. Here is what I have done so far:
<html>
<head>
<title>Un-ordered list</title>
</head>
<body>
<?php
$file = fopen("oscars.txt", "r")
$i=0;
while(!feof($myfile)){
$members[]= fgets($file);
}
fclose($file);
$arrlength =count($members)
$title = True;
for($i=0;$i<($arrlength);$i++){
if($title=True){
echo "<h2"> . $members[$i] . "<h2><ul>";
$title = False;
}
if(trim($members[$i])==''){
echo "</ul><h2>" . $members[{$i+1] . "</h2><ul>";
$i++;
} else {
echo "<li>" . $members[$i] . "</li>" ;
}
}
?>
</body>
</html>