This video is made for learning about String Function and sub string in PHP.
substr — Return part of a string
Description ¶
string substr ( string $string , int $start [, int $length ] )
Returns the portion of string specified by the start and length parameters.
Parameters ¶
string
The input string. Must be one character or longer.
start
If start is non-negative, 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 start is negative, the returned string will start at the start'th character from the end of string.
If string is less than start characters long, FALSE will be returned.
The substr function in PHP is used to retrieve a portion of the string. The syntax of the substr function is:
substr ('string', position_start, substr_length)
where position_start is the starting point (the first character has a position of 0). if position_start is a negative number, the starting position is the -(position_start)th character from the end. substr_length is the length of the string to be returned. If substr_length is a negative number, that means substr_legnth characters will be omitted from the end of the string.
On this page of the site you can watch the video online Learn PHP Tutorial 29 String Function and substring with a duration of hours minute second in good quality, which was uploaded by the user Champion Mahipal 31 December 2015, share the link with friends and acquaintances, this video has already been watched 237 times on youtube and it was liked by 3 viewers. Enjoy your viewing!