substr(): Returns a piece of a string

string substr ( string string, int start [, int length] )

$str= "Hello, how are you today? I am fine!";
if (strlen ($str) >= 30){
echo substr ($str,0,29);
} else {
echo $str;
}



More......

Comments