Numerology Calculator in PHP

php calculator

Sharing is caring!

PHP Numerology Calculator Script

This Numerology Calculator script based on PHP with the uses of Functions, Arrays, Conditional Statements.
Both Numerology methods(Chaldean, Pythagorean) are used in this program. Enjoy!

{code type=php}
}
elseif($method==’2′){
$title=’PYTHAGOREAN’;
$nval = array(a=>1, b=>2, c=>3, d=>4, e=>5, f=>6, g=>7, h=>8, i=>9, j=>1, k=>2, l=>3, m=>4, n=>5, o=>6, p=>7, q=>8, r=>9, s=>1, t=>2, u=>3, v=>4, w=>5, x=>6, y=>7, z=>8);
}
else{
$nval=0;
}

//calc word by word
for($i=0;$i<strlen($str);$i++){
$tot=$tot+$nval[$str[$i]];
}
$res=digitval($tot);
echo ‘

‘.$title.’

‘.strtoupper($str).’

‘.$res.’

‘;
}

function digitval($number) {
while($number > 0){
$rem = $number % 10;
$number = $number / 10;
$sum = $sum + $rem;
}

if(strlen($sum)>=2)
$res=digitval($sum);
else
$res=$sum;

return $res;
}

?>
{/code}

Demo Link

Sharing is caring!

  • oscar

    Hi, I try to add this code to a php new page, but doesnt work, what else I need to do? to this to work like the demo?

  • sharfuz

    dear can you add some extra feature in your code. like

    1. name
    2. father name
    3. mother name
    4. date of birth
    5. a to z value manually changing option
    6. show result and save to data base
    pleas dear help me on this matter. no mire now bye & TC

    Thanks and regards,
    Sharfuz Zaman
    +8801670182588

  • Good. I want to have on my site..How can do that? (that I copy script and save as .php…this is not enough

    • The Script is main and you can customize your design by your own

      • yes i know that its script yours..but how could have it on my site…if i can?
        Now I tryed to transform that scipt on my site…but??

        • If you need any customizations we will do it as our professional service.You can connect us at Skype:swotsolutions

  • matt

    $sum = $sum + $rem;

    here Undefined variable: why
    could you help me please;