EDIT: I call the function writecol() further down the page inside <table></table> tags.
Example of data in trxtt.txt:
South East asia,2222,code1
winter break,3333,code2
I am fairly new to php. I am trying to dynamically build table rows based off the variables read from an array. When I call this function I do not receive and error message, but nothing happens. Any ideas what I am doing wrong?
$x = file_get_contents('textt.txt');
$y = explode("\r\n", $x);
function writecol(){
foreach ($y as $value) {
$z = explode(",", $value);
echo "<tr class='visible'><td class='underlinecenter'>" . $z[0] . "</td> <td></td> <td colspan='3' class='underlinecenter'>" . $z[1] . "</td><td></td><td colspan='3' class='underlinecenter'>" . $z[2] . "</td></tr>";
}
}
textt.txt