cut text in php example
Example 1: php limit string length
if (strlen($str) > 10)
$str = substr($str, 0, 7) . '...';
Example 2: php get first character of string
$firstStringCharacter = substr("hello", 0, 1);
if (strlen($str) > 10)
$str = substr($str, 0, 7) . '...';
$firstStringCharacter = substr("hello", 0, 1);