php substring if length greater than string them .....

102

$out = strlen($in) > 50 ? substr($in,0,50)."..." : $in;
if(strlen(trim($string)) > 0){
   // $string has at least one non-space character
}

Comments

Submit
0 Comments