Gen. partnerAlgotech

PHP function substr()

Return part of a string

|
September 11, 2019

Availability in PHP 4.0

Return part of a string

Parameters

Parameter Data type Default value Note
$string string not String being processed.
$start int not If start is non-negative, the returned string will start at the start'th position in string, counting from zero. For example, in the string 'abcdef', the character at position 0 is 'a', the character at position 2 is 'c', and so on.
$length int null If length is given and is positive, the string returned will contain at most length characters starting from start (depending on the length of string).

Return values

string

|bool the extracted part of string or false on failure.

Other resources

Official substr documentation

Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.