 <p>You can do it like this (the ASCII codes are in order with the alphabet):</p> <pre><code>function check_str_for_sequences($str, $min = 3) { $last_char_code = -1; $total_correct = 0; $str = strtolower($str); for($i = 0; $i &lt; strlen($str); $i++) { //next letter in the alphabet from last char? if(ord($str[$i]) == ($last_char_code + 1)) { $total_correct++; //min sequence reached? if($total_correct &gt;= ($min - 1)) { return TRUE; } } else { $total_correct = 0; } $last_char_code = ord($str[$i]); } return FALSE; } </code></pre> <p>Usage:</p> <pre><code>$test = 'Lorem ipsum dolor abcsit amet'; echo '-----&gt;' . check_str_for_alpha($test); // -----&gt;1 </code></pre>