PHP: Cut string using last character searched