I am trying to take (to later delete) the text after a specific character for example:
$char = "This is an example text but this text needs it\n this text no longer";
I only want the text before the "\n" after that I want to delete it
EDIT:
I want you to return something like this:
This is an example text but this text needs it