Mega Code Archive

 
Categories / Php / Strings
 

Accessing Substrings

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