What is substr() in PHP? and how it is used?

It is used to extract a part of the string. It allows three parameters or arguments out of which two are mandatory, and one is optional

echo substr("Hello world",6);

It will return first six characters from a given string.

Suggest An Answer

No suggestions avaliable!

Latest post from PHP interview questions

Ask Question