Ask coding questions

← Back to all posts
How do you open PHP files?
GeoneveStudios (9)

I've been trying so hard to open it, How do you do it? This is my code:

<?php 
function sayHello() {
  echo "<p><b>Hello, World!</b></p>";
}
sayHello();
?>

And this is what I keep getting:

Comments
hotnewtop
Coder100 (18146)

php files are not meant to be opened. They must be actually converted into HTML in order to properly render onto the page.

clearly, nobody wants to set it up, so replit set it up for you. Just click this: https://replit.com/new/php7

and write your PHP :DDDD

19ecal (232)

Try return in the function, then echo sayHello()

19ecal (232)

Also add a ; after the function