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.
Sur cette page du site, vous pouvez voir la vidéo en ligne Learn PHP Tutorial 29 String Function and substring durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Champion Mahipal 31 décembre 2015, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 237 fois et il a aimé 3 téléspectateurs. Bon visionnage!