/ Published in: PHP
- //Storing a long string in a variable.
- $string = "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.";
- //Display the string in it's original format.
- echo $string;
- //Get the lenght of the string.
- $str_length = strlen($string);
- echo "<br/>";
- //Method to chunk and replace a long string with some characters if you have space issues.
- if($str_length > 25)
- //displayig the replaced string.
You need to login to post a comment.