Table column elements not appearing

	<table>
	<thead><tr>
    <?php
        $labels = array('name' => 'Name', 'surname'=>'Surname', 
            'address'=>'Personal Address', 'email'=>'Email', 'city' => 'City');
        foreach ($labels as $i => $label) {
            echo "<th>" . $label . "</th>";
        }
    ?>
    </tr></thead>
    <tbody>

    <?php

    foreach (glob("*.dat") as $file) {
        $h = fopen($file, 'r');
        $data = fread($h, filesize($file));
        fclose($h);

        $arr = unserialize($data);

        echo "<tr>";
        foreach ($labels as $i => $i_value) {
            echo "<td>" . $arr[ $i ] . "</td>";
        }
        echo "</tr>";
    

    }

    ?>
elements I have saved in the file for the personal address column do not appear under it.

Then step through your code with var_dump() on every variable like the glob(), $file, $data, etc.

Sponsor our Newsletter | Privacy Policy | Terms of Service