This kind of question is sometimes looks funny! but you know this is asked many times in Technical Interview Questions!!.
Yes, I think if you are here then you also crossed the situation what i had in my life!.
If you don’t lets take this time to learn something useful and new which will guide you in the future interviews!
There are plenty of ways to do this!. The first one I’m going to show is the one which is not used any of the build-in string function but it is limted too!.
1st way (without using any string function):
$count = 0;
for($i=0; $i<1000000; $i++)
if(@$str[$i] != "")$count++;
echo mystrlen("this is really useful");
2nd way (using a string function):
$string = "this is too great";
$strlen = count(str_split($string));
I hope this helps you in many places thanks!