Returns the portion of string specified by the start and length parameters.
SubString ( string $string , int $start [, int $length ] )
The input string. Must be one character or longer.
The returned string will start at the start’th position in string, counting from zero. For instance, in the string ‘abcdef’, the character at position 0 is ‘a’, the character at position 2 is ‘c’, and so forth.
If length is given, the string returned will contain at most length characters beginning from start (depending on the length of string).
$s = "hello world" $s1 = substring($s,1) msgbox($s1) // outputs "ello world" $l = stringlen($s) $s2 = substring($s, 0, $l-1) msgbox($s2) // outputs "hello worl"
If you have specific usage questions, visit the Sick Editor forum
- 24 May, 2012 @ 20:36 [Current Revision] by Sick
- 22 May, 2012 @ 0:08 by Sick