PHP Accessing Substrings: String Substr ( String String, Int Start [, Int Length] ) – String Function

<?php $theclientstext = "this is a test. this is another test"; if (strlen ($theclientstext) >= 30){
    echo substr ($theclientstext,0,29);
} else {
    echo $theclientstext;
}
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.