html - Php division not working -


for reason when ever compile code, gives me zero. why this?

$aou = 5; //amount of upvotes $aod = 2; //amount of downvotes $elo = (auo/aod) * 150; //elo echo "your elo is: " . $elo; 

the problem type auo , aod instead of $auo , $aod. php trying constants of names, , not variables.

constants defined , used without dollar sign, e.g.

const foo = 123; echo foo; 

but variables need $ every time use them, thus

$bar = 123; echo $bar; 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -