hi all;
I have a recursive function the read the file, but its doesn work properly so It a big problem for me as a newbie in php, i need help to someone, here is my function that read the file and returning the line of file as array of string.
function processFile($filename) {
$lines = file($filename);
$returnArray= array();
foreach ($lines as $line) {
$output=processFile($string);
if (gettype($output)=="array") {
$returnArray[]='<tr><td>Title:</td><td>'.($output[0]).'</td><td>Value:</td><td>'.$output[1].'</td></tr>';
}
}
return $returnArray;
}
I have another page to test the my function if it running but this is the way i got the error.
require_once('chadlib.php');
$string = file('test.php');
$strings=processFile($string);
echo '<table>';
foreach ($strings as $element => $value) {
echo $value;
echo '</table>';
}
please check theline of my code. thank in advance.