Example #1
0
function show_filmography()
{
    $result = "";
    foreach (range(1, 55) as $number) {
        $film_info_array = find_selected_film_as_array($number);
        $result .= create_table_item($film_info_array, $number);
    }
    return $result;
}
    $a = $_GET["a"];
}
// Get the headers out of the way...
$finalString = "<tr>";
$finalString .= "<th>Number</th>";
$finalString .= "<th>Title</th>";
$finalString .= "<th>Release Year</th>";
$finalString .= "<th>Genre</th>";
$finalString .= "<th>Wrote?</th>";
$finalString .= "<th>Acted?</th>";
$finalString .= "<th>Directed?</th>";
$finalString .= "<th>Runtime<br />(Minutes)</th>";
$finalString .= "</tr>";
foreach (range(1, 55) as $number) {
    // This for loop goes through each film
    $film_info_array = find_selected_film_as_array($number);
    /*
      $validChoice starts as true, and is changed to false if the film does 
      not match the input on the form.
    */
    $validChoice = true;
    /*
     Each $_GET variable is checked against the default value. If it has been 
     changed, it is compared with the film in question. If it is not a match,
     $validChoice is changed to false. Every value passed to the form must
     match the corresponding value for the film, or the film will not be displayed.
    
     i.e. If the genre matches, but the written variable does not, the film
     will not be displayed.
    */
    if ($g != "any") {