+ 2

What is the problem in the below code? Why don't I get the output? Also tell why when I view this in browser I see blank Webpage

<!DOCTYPE html> <html> <head> <title>Arrays</title> </head> <body> <?php $numbers = array(18,21); $sum = $numbers[0] + $numbers[1]; echo "Sum of two variables is" . $sum; ?> </body> </html>

13th May 2017, 1:33 PM
Vishnu ks
Vishnu ks - avatar
3 Respostas
+ 6
Are you in a web project of code playground? Because you need to be in a php project to be able to run php code :P
13th May 2017, 1:40 PM
visph
visph - avatar
+ 5
Because you're probably in a web project: so your php code is not interpreted, and nothing is displayed, as default dehaviour of html is to ignore unknown tags ^^
13th May 2017, 1:44 PM
visph
visph - avatar
+ 2
And what about the last question
13th May 2017, 1:42 PM
Vishnu ks
Vishnu ks - avatar