How to use string length function in php

PHP

We will show you complete detailed example for getting string length in PHP. We will give you proper example which will explain you and then you can copy that code and you can easily test it in the local php file . This example will be simple and easy to understand as a user friendly language.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>String Length Example in PHP</title>
</head>
<body>
<h1>
<?php
//This is the Simple example with the string variable you can get the string length
$name = "John Corner";
echo strlen($name);
//The Result will be 11 which will show you the length of the string
?>
</h1>
</body>
</html>
-->