Why does this breaks the code? \n"; ?> It shows \n"; ?> in my website
Looks as though it goes to `br>` and thinks this is closing the php tag. Then it echos the remaining part.
This really shouldn't happen though, since you would need ?> to close the tag. I'm not getting the same results when I try out your code.
It could have something to do with your configuration.
I would guess you're trying to open the php file in a browser rather than visiting a served page. Also, you're not going to have any output from that particular statement if you were to serve it and visit it because you're just performing an assignment, not echo'ing or printing anything to the page. If you are trying to display this on the same computer that you're developing on, you'll need to host the page on a web server. Check out wampserver for windows, or xamp for linux, mamp for mac etc. They're packages that will install apache, mysql, and php on your machine so you can run the page locally (by going to http://localhost/file.php, not by double clicking the php file)
Thanks!
No problem, I'm glad I could help
Join our real-time social learning platform and learn together with your friends!