string substr ( string str, int start_pos [, int length] ) reads part of a string and takes a minimum of two parameters
<?
$message = "Goodbye, Perl!";
$a = substr($message, 1);
$b = substr($message, 0);
// $b contains the full string because we started at index 0
$c = substr($message, 5);
$d = substr($message, 50);
$e = substr($message, 5, 4);
$f = substr($message, 10, 1);
?>
Related examples in the same category