+ 2
Please check this code it is showing error plz fix it or tell me what and where is the problem in this code.
12 Answers
+ 3
Brother, the reason is because there was some invalid characters copied, those characters look like space but they are not, and PHP compiler see those characters as something annoying, the compiler doesn't know how to process the characters, and so the code fails to execute, can you understand what I mean bro?
You also need to delete and type again the space between echo and $txt, $x and $y respectively.
<?php
$txt="Hello world";
$x=5;
$y=10.5;
// delete and type space again before $txt
echo $txt;
// delete and type space again before $x
echo $x;
// delete and type space again before $y
echo $y;
?>
Or you can try this too
<?php
$txt="Hello world";
$x=5;
$y=10.5;
echo "$txt<br />$x<br />$y";
?>
Remember to delete and type space again between echo and "$txt...";
Hth, cmiiw
+ 4
Bro, can you tell me what is your browser? I want to try using web SoloLearn too, to save my data usage, I used Opera Mini, but it doesn't work well with SoloLearn web, I'm looking for alternatives. I am using theAndroid app for now...
+ 3
Okay bro I understand, good luck and keep learning bro.. Cheers!
+ 2
If you are using web browser there's a possibility that the code contains invalid characters when you pasted it, delete spaces in the assignments and calls to echo.
$txt = "Hello world!" => $txt="Hello world!";
$x = 5; => $=5;
Hth, cmiiw
+ 2
check now cleared all the spaces but noting happened.
bro plz fix.
+ 2
ohk but I am studying from w3schools site in chrome so I copied this code from that.
+ 1
https://code.sololearn.com/w8Ct5S7kPP6v/?ref=app.
but now check that code whats the problem now bro plz tell me I had fix it but then also it is giving error.
+ 1
wait bro checking.
+ 1
yeah bro when I write code my self it is working older code is copied from web but I don't understand why this had happened as the code is the same can u plz tell me whats tge reason behind or whats had happened
+ 1
Hmmm bro I understand very clearly thx for this answer this is the best answer.
+ 1
thx bro