strlen()
` is used to get the length of a string. It returns the number of characters in a string, including spaces and special characters.<?php
$string = "Welcome to Free Time Learn";
$length = strlen($string);
echo "The length of the string is: " . $length;
?>
The length of the string is: 26
strlen()
` is a binary-safe function, which means that it can handle strings containing null bytes (\0
) as well.