Skip to content

Instantly share code, notes, and snippets.

@ruslanashaari
Created September 10, 2017 15:01
Show Gist options
  • Save ruslanashaari/f818cb8e9be3a5d40fcdbd651304a7ac to your computer and use it in GitHub Desktop.
Save ruslanashaari/f818cb8e9be3a5d40fcdbd651304a7ac to your computer and use it in GitHub Desktop.
Determine if a word or phrase is an isogram.
<?php
function isIsogram($phrase){
$array_phrase = str_split(strtolower(preg_replace('/[\s-äöü]/', '', $phrase)));
return count($array_phrase) == count(array_unique($array_phrase));
}
@ruslanashaari
Copy link
Author

isogram (non-pattern word) is a word/phrase without a repeating letter. eg: word isogram is an isogram, but word isograms not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment