substring - How to get the last chars of a string that ends with a new line ( ) in PHP?
one text
Solution:
$org = "this is just a test...\n";
if (substr($org, -4) == "...\n") {
echo "Yes\n";
{
else {
echo "No\n";
}
Will output 'Yes'
\n \t \r The \ is just to 'escape' the character it still only takes up 1 character.
Source