If you want just the names beginning with a character this should do it: $names = preg_grep ( '/$character/i', $lastnames ); To get the names from $start to $end (both being single characters) do this: $names = preg_grep ( '/[$start-$end]/i', $last_names ); Arne :wq