範例
<?php
$String1="I want to buy a new car.";
$String2="123456789";
echo 'String1 length is: '.strlen($String1).'<br>';
echo 'String2 length is: '.strlen($String2);
?>
$String1="I want to buy a new car.";
$String2="123456789";
echo 'String1 length is: '.strlen($String1).'<br>';
echo 'String2 length is: '.strlen($String2);
?>
以上程式碼為 PHP strlen 函數的範例程式碼。