wrap text after 5 words and show 3 dots using php code example Example: php trim string if longer than substr($str,0,50);