1<?php
2$str = 'abcdef';
3echo strlen($str); // 6
4
5$str = ' ab cd ';
6echo strlen($str); // 7
7?>
1var myString = "string test";
2var stringLength = myString.length;
3
4console.log(stringLength); // Will return 11 because myString
5// is 11 characters long...
1var colors = ["Red", "Orange", "Blue", "Green"];
2var colorsLength=colors.length;//4 is colors array length
3
4var str = "bug";
5var strLength=str.length;//3 is the number of characters in bug