cut symbol from the end of a string php code example
Example 1: get last character of string php
substr("testers", -1); // returns "s"
Example 2: php string cut first x characters
$str = "The quick brown fox jumps over the lazy dog."
$str2 = substr($str, 4); // "quick brown fox jumps over the lazy dog."
Example 3: php substr remove last 4 characters
echo substr($string, 0, -3);
Example 4: remove space from start and end of string in php
$trimmed = trim($text);
var_dump($trimmed);