Home » » substr

substr

Written By 1 on Sunday, September 30, 2012 | 9:56 AM

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

Return part of a string

Returns the portion of string specified by the start and length parameters.


<?php
$rest 
substr("abcdef", -1);    // returns "f"
$rest substr("abcdef", -2);    // returns "ef"
$rest substr("abcdef", -31); // returns "d"
?>

5.2.2 - 5.2.6 If the start parameter indicates the position of a negative truncation or beyond, false is returned. Other versions get the string from start.


Mysql Left Substring

0 Comment:

Post a Comment