I have a peragraph with some new lines :
First line
Second line
Third line
And this is the last line
I want to get the second line from the above peragraph.
So the result I want should be :
"Second line"
I have tried the following script with preg_match_all() function but I don't know why it's not working.
<?php
$pera="First line
Second line
Third line
And this is the last line";
preg_match_all("#\n+{2}.*+#",$pera,$results);
print_r($results);
Do you have any idea how to get the second line from the paragraph?
Any help is much appriciated.
Thanks!