[PHP] How to display one line from a file rather than the whole lot

2001-11-30 Thread Kevin Garrett
Hi guys, I'm looking to edit this to just return one particular line rather than the whole file: ?php // get a web page into an array and print it out $fcontents = file ('http://www.php.net'); while (list ($line_num, $line) = each ($fcontents)) { echo bLine $line_num:/b . htmlspecialchars

Re: [PHP] How to display one line from a file rather than the whole lot

2001-11-30 Thread Hank Marquardt
The key will be to put some kind of 'if' around your echo statement, but since you didn't say what the criteria for display is it's pretty tough to help any further. If the criteria is content driven, preg_match or ereg are you're answer, if it's the X'th line in the file then you could probably