programming-examples/php/Basics/PHP program to check if a given string is an anagram of another given string..php

15 lines
326 B
PHP
Raw Permalink Normal View History

2019-11-18 14:44:36 +01:00
<?php
function is_anagram($a, $b)
{
if (count_chars($a, 1) == count_chars($b, 1))
{
return "This two strings are anagram";
}
else
{
return "This two strings are not anagram";
}
}
print_r(is_anagram('anagram','nagaram')."\n");
print_r(is_anagram('cat','rat')."\n");
?>