Created
November 15, 2013 17:34
-
-
Save anonymous/7488341 to your computer and use it in GitHub Desktop.
PHP Code to find the common alphabets in AMITABH BACHCHAN and RAJNIKANTH
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 "<h1>PHP Code to find the common alphabets in AMITABH BACHCHAN and RAJNIKANTH</h1>"; | |
$string1 = "AMITABH BACHCHAN"; | |
$string2 = "RAJNIKANTH"; | |
$a1 = strlen($string1); | |
$a2 = strlen($string2); | |
echo "common alphabets in AMITABH BACHCHAN AND RAJNIKANTH are :\n"; | |
for($i = 0;$i<$a1;$i++) | |
{ | |
for($j=0;$j<$a2;$j++) | |
{ | |
if($string1[$i]==$string2[$j]) | |
echo $string1[$i]; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment