Ask coding questions

← Back to all posts
1
<?php?> tag doesn't work
MarkelL (10)

I am just starting to learn php. But because of some weird reason, the <?php?> tag in my html page doesn't work. CAn someone explain why?
I believe the html does not read it.
https://repl.it/@MarkelL/Test

Answered by timmy_i_chen (934) [earned 5 cycles]
View Answer
Commentshotnewtop
1
timmy_i_chen (934)

We made some updates to PHP (well, we made two new "languages"):

https://repl.it/languages/php_cli - New and improved PHP language for command line interface shenanigans. Supports multiple files.
https://repl.it/languages/php7 - PHP Web servers! Just like other hosted repls, this allows you to write websites using PHP.

Enjoy!

2
CaptainAnon (27)

PHP is a different language to HTML. It is run on a server, before the page is sent to the client. Browsers cannot run PHP.

Just realised how difficult it is to read the phrase "browser tries to render file"