<?php $path = "A000AA00"; $startA = microtime(true); for($i = 0; $i < 100000; $i++) { if (strlen($path) !== 8) { die('Bad string length'); } if (ctype_alpha($path[0]) && ctype_digit($path[1]) && ctype_digit($path[2]) && ctype_digit($path[3]) && ctype_alpha($path[4]) && ctype_alpha($path[5]) && ctype_digit($path[6]) && ctype_digit($path[7])) { // We good } } $endA = microtime(true); echo $endA-$startA;
You have javascript disabled. You will not be able to edit any code.