I am new to the forum here and will be grateful for any help you can provide.
I've been over and over my code and I can't find anything wrong with it.
It was working for a few minutes, then I removed some comments, and since then I haven't been able to get it working.
I am using some code to split lines from a Asterisk queue log into nested arrays. I can't get it to output anything. All I get is the "white screen."
Here's the code:
Code: Select all
<?php
$file_handle = fopen("queue_log", "r");
while (!feof($file_handle) && $max_lines-- > 1000)
{
$line_of_text = fgets($file_handle);
$parts = explode('|', $line_of_text);
$stack[] = $parts;
}
print_r ($stack[0]);
fclose($file_handle);
?>
1. Open the file queue_log and read 1000 lines from it.
(the file is about 5MB and I'm sure I'm not running out of memory because when I do I get an error in the browser telling me I have run out of memory).
2. Explode all of the lines into separate arrays.
3. Store the arrays in nested arrays.
4. Print the first nested array '0' from the $stack array
I hope someone can make suggestions on how to fix this.
Thanks in advance!
Maj