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