ExamCompetition Forum Question Papers Ask A Question Mock Test Learn & Earn Sign Up Login Menu



0 vote

What will be the output of the following PHP code?<?php$total = "25 students";$more = 10;$total = $total + $more;echo "$total";?>

Asked on by | Votes 0 | Views: 41 | Tags: computer science     | php     | basic php     | Add Bounty

What will be the output of the following PHP code?<?php$total = "25 students";$more = 10;$total = $total + $more;echo "$total";?>

A).  Error

B).  35 students

C).  35

D).  25 students


Share on Facebook      Share on Whatsapp       Share on Twitter




1 answers

0 vote
Answered by on | Votes 0 |

 35



The integer value at the beginning of the original $total string is used in the calculation. However if it begins with anything but a numerical value, the value will be 0.

Join Telegram Group




Answer This Question

Name:
Email:
Answer :
Sum of (5+4)
Submit: