0
Sometimes the output doesnt work. Workaround?
This is a hello world script, one line, no output.
3 Answers
+ 2
Can you share a link to it or paste the full content of your PHP script?
There isn't enough detail in your question to say why it sometimes doesn't work. An echo statement always works if it is written properly.
+ 1
Kevin wrote, "<?php
echo "Hello world";
?>
I dont have a link."
Answer:
Kevin, that works for me every time.
I tried refreshing multiple times with a local installation of WAMP. I ran it in Sololearn's Code Playground.
It always prints "Hello world" for me.
How are you running it? Are you running it locally using WAMP or XAMPP?
I wonder if there's something completely unrelated to the script that causes it to not work for you some of the time. For example, if you forgot to run your server, it definitely won't work. If you're using an unreliable web hosting service, it sometimes won't work. If your Internet connection is weak and you're running the script remotely, you can get disconnected at times and you won't see output. Sololearn's Code Playground sometimes doesn't always run properly regardless of the correctness of your script.
0
<?php
echo "Hello world";
?>
I dont have a link.