Created
April 24, 2013 11:41
-
-
Save rakeybulhasan/5451519 to your computer and use it in GitHub Desktop.
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 //echo "dfaf afa";?> | |
<?php | |
//$palindrome= 'madam'; | |
function palindrome($palindrome){ | |
$split= strrev($palindrome); | |
$split1=str_split($palindrome); | |
$split2=array_unique($split1); | |
if($split){ | |
echo $palindrome. ' is palindrome'; | |
}else{ | |
echo $palindrome. ' Not palindrome'; | |
} | |
echo '<br>'; | |
foreach($split2 as $aa){ | |
echo $aa . ' is palindrome'.'<br>'; | |
} | |
//print_r($split1) ; | |
} | |
palindrome('madam'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment