Created
September 10, 2017 15:01
-
-
Save ruslanashaari/f818cb8e9be3a5d40fcdbd651304a7ac to your computer and use it in GitHub Desktop.
Determine if a word or phrase is an isogram.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function isIsogram($phrase){ | |
$array_phrase = str_split(strtolower(preg_replace('/[\s-äöü]/', '', $phrase))); | |
return count($array_phrase) == count(array_unique($array_phrase)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
isogram (non-pattern word) is a word/phrase without a repeating letter. eg: word isogram is an isogram, but word isograms not