Skip to content

Instantly share code, notes, and snippets.

@TheRealJAG
Created April 8, 2016 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheRealJAG/3d3ba9bff8dbce5577e6efcdeb0083f5 to your computer and use it in GitHub Desktop.
Save TheRealJAG/3d3ba9bff8dbce5577e6efcdeb0083f5 to your computer and use it in GitHub Desktop.
<?php
class AreAnagrams
{
public static function areStringsAnagrams($a, $b)
{
return(count_chars($a, 1) == count_chars($b, 1));
}
}
// For testing purposes (do not submit uncommented):
/*
echo AreAnagrams::areStringsAnagrams('momdad', 'dadmom') ? 'True' : 'False';
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment