Skip to content

Instantly share code, notes, and snippets.

Created November 15, 2013 17:34
Show Gist options
  • Save anonymous/7488341 to your computer and use it in GitHub Desktop.
Save anonymous/7488341 to your computer and use it in GitHub Desktop.
PHP Code to find the common alphabets in AMITABH BACHCHAN and RAJNIKANTH
<?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