Changes

Working with Strings and Text in PHP

350 bytes added, 14:36, 4 June 2007
PHP printf formatting specifiers
<tt>My number is ___12.208999.</tt>
 
== Finding the length of a PHP String ==
 
The length of a PHP string can be obtained using the ''strlen()'' function. The ''strlen()'' function takes the string as an argument and returns the length value:
 
<pre>
<?php
 
$myString = "This is a short string";
 
$strLength = strlen ($myString);
 
echo "The string length is $strLength.<br>";
 
?>
</pre>