0

Why is the output like this??

in this php code: <?php for ($a = 0; $a < 6; $a++) { echo "Value of a : "+ $a + "<br />"; } ?> output: 012345 why does the string text dont get printed?

10th Jan 2019, 10:23 AM
Tensa
Tensa - avatar
5 odpowiedzi
+ 6
Try to write echo "Value of a : ". $a ."<br/>"; instead
10th Jan 2019, 10:51 AM
Uni
Uni - avatar
+ 6
Sorry I don't know 😕😕 And you're welcome 👍👍
10th Jan 2019, 10:55 AM
Uni
Uni - avatar
+ 1
yes, that is there it works with the dot . but do you know what happens when the + symbol is put? thanks
10th Jan 2019, 10:53 AM
Tensa
Tensa - avatar
+ 1
In php + is meant for arithmetic operations only for concatation u need use .(dot) operator
10th Jan 2019, 11:38 AM
Adarsh.n. Bidari
Adarsh.n. Bidari - avatar
0
yes thank you very much
10th Jan 2019, 12:00 PM
Tensa
Tensa - avatar