count length of a string

PHP
<?php
$str = 'php';
echo strlen($str); // 3

$str = 's p a c e';
echo strlen($str); // 9
?>
Source

Also in PHP: