strlen() method returns the number of bytes in a given string.
string can either be a literal sequence of characters surrounded by quotes or a variable that refers to such a sequence.
The following example showcases the two ways of using the
Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.
Learn PHP on Codecademy
Computer ScienceLooking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
Includes 6 Courses
With Professional Certification