Hello, I have a list of interviews divided by which are inside a file that I open, read, enter into an array, reverse the order of and then print on the screen in the reversed order (the newest one first).
This is the code:
$filelocation = 'interviews.inc';
// Open the datafile and read the content
$file_pointer = fopen($filelocation,"r");
$content = fread($file_pointer, filesize($filelocation));
fclose($file_pointer);
// Remove the slashes PHP automatically puts before special characters
$content=stripslashes($content);
// Put the entries into the array lines
$lines = explode(" ",$content);
// Define and fill the reverse array (showing the last entry first)
$rev = array();
$f=0;
for ($i=sizeof($lines)-1;$i>=1;$i--){
$rev[$f]=$lines[$i];
$f++;
}
$lines=$rev;
for($l=0;$l<count($lines);$l++) {
echo '<li>'.$lines[$l];
}
This list is getting long and for aesthetical purposes I have been thinking of dividing the list into a table with two columns.
Here is my problem. Can somebody suggest the code to do that?
I am assuming I have to divide an array into two different parts either before or after the reversal and then print one part between the first <td> tag and the other in the second column.
What I don't know is how to do this, especially because this array changes in size constantly so there is no way to know where to cut precisely and I don't know hot to determine 50% of an undefinite value, if you know what I mean...