Create your own Love Calculator – using PHP

As all of you know that a person name can tell a lot about his personality. All names have a some meaning.

Let’s find out what the chances for you and your dream partner are, just try the below code and get your love score.


//$yourN = $_POST['yourN'];
//$yourPN = $_POST['yourPN'];
$lovename=strtolower(preg_replace("/ /", "", strip_tags(trim($yourN . $yourPN))));
$alp =count_chars($lovename);
for ($i=97; $i <= 122; $i++)
{
if ($alp[$i] != false)
{
$anz=strlen($alp[$i]);
if ($anz < 2)
{
$calc[]=$alp[$i];
}
else
{
for ($a=0; $a < $anz; $a++) { $calc[]=substr($alp[$i], $a, 1); } } } } while (($anzletter=count($calc)) > 2)
{
$lettermitte = ceil($anzletter / 2);
for ($i=0; $i < $lettermitte; $i++)
{
$sum = array_shift($calc) + array_shift($calc);
$anz =strlen($sum);
if ($anz < 2)
{
$calcmore[]=$sum;
}
else
{
for ($a=0; $a < $anz; $a++)
{
$calcmore[]=substr($sum, $a, 1);
}
}
}
$anzc=count($calcmore);
for ($b=0; $b < $anzc; $b++)
{
$calc[]=$calcmore[$b];
}
array_splice($calcmore, 0);
}
echo $calc[0] . $calc[1];

To check the live demo of this code, click here and enter your and your partner(crush) name.

Leave a comment