Hey guy, I really need your help with this.
I have Input from a text area, in this format:
a
b
c
d
e
f
g
12
34
435
124
What I need do to is to output only a certain line from every block of text, every block is divided by one or more empty lines.
I have done this:
$input = $_POST["input"];
$lines = explode("\r",$input);
$num = count($lines);
$line_to_extract = $_POST['line_to_extract'];
for($i=0;$i<$num;$i++)
{
if($i == $line_to_extract)
{
echo 'Line '.$i.': '.$lines[$i].'<br />';
}
}
What I need to do is to detect the empty line so I can keep track of the line to extract.
PLEASE HELP!!!