Can someone gimme the idea to check if any string elements of an array are longer than "x" characters. In other words, pretend that theres an array which we dont know how many elements it has. And this array only keeps strings. All i want is a code that returns false if theres any long string than 20.
Simple! Here is the code! PHP: <? function check_array_string(&$arr,$length=10) { foreach($arr as $v) if(strlen($v)>$length) return false; return true; } ?> Example: PHP: $a = ["sas","aasew","wewr"];check_array_string($a,20);