- 1

$x=5/*+15*/+7; echo $x;

can any explain me this code

11th Jun 2017, 4:50 AM
Ram Charan
6 Answers
+ 1
The $ is used to define var name in PHP /*this is a comment text*/ in PHP ; you use a semicolon { ; } to finish the statement. the echo statement prints the var so $x=5*/+15*/+7; echo $x; is more like $x= 5 + 7; echo $x; /* { 12 } */
11th Jun 2017, 5:26 AM
Lord Krishna
Lord Krishna - avatar
+ 1
From what source are you posting this? your code is incorrect! Are you even using the CodePlayground in the Sololearn app?
11th Jun 2017, 6:06 AM
Lord Krishna
Lord Krishna - avatar
0
thank youâ˜șâ˜șâ˜ș
11th Jun 2017, 5:34 AM
Ram Charan
0
$rs=2."2"; echo 2.$rs.$rs;
11th Jun 2017, 5:35 AM
Ram Charan
0
Sure, but that is incorrect $rs = 2.2; echo $rs.$rs;
11th Jun 2017, 5:45 AM
Lord Krishna
Lord Krishna - avatar
0
$rs=2."2";echo 2.$rs-$rs;....answer is 200...how??
11th Jun 2017, 5:49 AM
Ram Charan