Contact US


Get Your Project Done by our experts
info@fundaofwebit.com

How to find string length without using build-in function strlen in php

Whatsapp

https://www.fundaofwebit.com/post/how-to-find-string-length-without-using-build-in-function-strlen

How to find string length without using build-in function strlen() in php


Here, in this article, we are going to learn about how to find the total string length withour using any predefined function or built-in function like strlen() function of php.

So guys, now let's begin with it:


<?php

$string = "ved";

$string_lenght = 0;
while($string[$string_lenght] != null){
$string_lenght++;
}

echo "Total String Length : ". $string_lenght;

?>


Output: 

Total String Length : 3


Thanks for reading.

© Copyright - 2018 - 2021 | All rights reserved at Funda of Web IT