program that print out the length of each string php code example Example: php string length <?php $str = 'Hello World!'; echo strlen($str); // 12 ?>