string strlen function - returns the length of the given string
string-strlen-function-in-php.php
<!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>
<title>string strlen function - returns the length of the given string</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Md Iqbal Hosan">
<meta name="title" content="string strlen function - returns the length of the given string">
<meta name="keywords" content="php, example, code, array, function, strlen , string">
<meta name="description" content="string strlen function - returns the length of the given string">
<style>
h2, h4{background:#ccc; color:#000079;}
h2{ padding:3px; margin:3px; font-size:21px;}
h4{ padding:2px; margin:2px; font-size:17px;}
p{padding:2px; margin:2px; color:#0099FF;}
body{ background:#FFFFFb;}
</style>
</head>
<body>
<h2>string strlen function - returns the length of the given string</h2>
<pre>
<?php
/*
-----------------------------
let me tell you my boss name
-----------------------------
*/
$myBossName = "Sk Saiful Islam (cfsuman)";
echo "<h4>Output of myBossName</h4>";
print "<p>$"."myBossName = {$myBossName}</p>";
/*
--------------------------------------------------------------------
now i want to get the length of the string by using strlen function
--------------------------------------------------------------------
*/
$stringLength = strlen($myBossName);
echo "<h4>Output of stringLength by using string strlen function</h4>";
print "<p>$"."stringLength = {$stringLength}</p>";
print "<p>My boss's name is {$stringLength} characters long.</p>";
/*
-------------------------------------------------------
this function rapidly used in professional programming
to find the length of a string.
-------------------------------------------------------
*/
?>
</pre>
</body>
</html>

No comments:
Post a Comment
leave your comments here..