1.

How to calculate the length of a string?

Answer»

We can CALCULATE the LENGTH of a string with strlen() FUNCTION in PHP.

$var1 = “This is good interview Question”;
echo strlen($var1);

9. What is the use of strpos in PHP?

strops() method is used to get the position of the first occurrence of a string inside another string.

Example

$mainString = 'Best Interview Question';
echo strpos($mainString, "Interview");
// OUTPUT : 5



Discussion

No Comment Found