? $ Restsubstr (abcdef, 1); returnsbcdefechosubstr (abcdef, 1) returns. $ rest.br; $ restsubstr (abcdef, 1, 3); returnsbcdechosubstr (abcdef, 1, 3) returns. $ rest.br; $ restsubstr (abcdef,-1); returnsfechosubstr (abcde SUBSTR
$ Rest = substr ("abcdef", 1); // returns "bcdef"
Echo 'substr ("abcdef", 1) returns '. $ rest ."
";
$ Rest = substr ("abcdef", 1, 3); // returns "bcd"
Echo 'substr ("abcdef", 1, 3) returns '. $ rest ."
";
$ Rest = substr ("abcdef",-1); // returns "f"
Echo 'substr ("abcdef",-1) returns '. $ rest ."
";
$ Rest = substr ("abcdef",-2); // returns "ef"
Echo 'substr ("abcdef",-2) returns '. $ rest ."
";
$ Rest = substr ("abcdef",-3, 1); // returns "d"
Echo 'substr ("abcdef",-3, 1) returns '. $ rest ."
";
$ Rest = substr ("abcdef", 1,-1); // returns "bcde"
Echo 'substr ("abcdef", 1,-1) returns '. $ rest ."
";
?>
For specific use, see function.substr.html in manualof PHP.