Other User Diary
php defining maximum character of string


echo substr("hello html", 0, 4);

?>

output  will  :  hell 


other substr examples 

<?php

$rest = substr("abcdef", 0, -1);  // returns "abcde"
$rest = substr("abcdef", 2, -1);  // returns "cde"
$rest = substr("abcdef", 4, -4);  // returns false
$rest = substr("abcdef", -3, -1); // returns "de"

?>



x-xmax
Country       UNITEDSTATES
City               Ohio
Posted On   13/02/2012

5



Other Pages