ranz wrote:I mean, i directly open it with my browser using the run button in the taskbar of the notepad.
That will not work.
PHP is a serverside running programming language so every php code needs to be parsed by the php interpreter first.
Your Notepad does not know that you have running a php interpreter somewhere on your computer and where to find it.
ranz wrote:The html code i made is working fine with this method. But in php, the output is the same as you typed it in the notepad.
Your browser does not know anything about a php interpreter too. It can only process code it can understand which is HTML, CSS and JS.
Everything else will simply get outputted as plain text.
ranz wrote:C:\xampp\htdocs\hello.php, this is the path of my file.
Then the correct URL would be http://localhost/hello.php
, no htdocs in the URL.