I have a text area, I need parse text when form is submitted.
For example I need to get first string from this text area, get it and left whole text as is. I don't want to use nl2br function and then use pattern with <br />. Can I just parse \n chars and if so how? I can't do it in my php code, but I can in regex tester link to example is below.
this is my code that doesn't work:
preg_match('/(.+)\n\n/', $_POST['text'],$title);
$title = $title[0];
echo $title;
it returns nothing. Help me to change this, thanks.
EDIT

 
     
     
     
    