Sr. PHP Programmer Question:
Download Questions PDF

How will you find the length of a string in PHP?

Answer:

The strlen() function is used to find the length of a string. Let's find the length of our string "Hello world!" −

<?php
echo strlen("Hello world!");
?>
This will produce following result −

12

Download Senior PHP Programmer Interview Questions And Answers PDF

Previous QuestionNext Question
How will you retrieve code of exception using Exception class in PHP when error occured?What are the rules for determine the "truth" of any value not already of the Boolean type?