Greetings guys,

I am barely new to php and i have incoming presentation from a company and they asked me to build some basic website using sublime text 2. here's my problem i don't have any clue on how to display result from php to a web browser. In notepad++ you only need to save it as. e.g: HelloWorld.php; How about in sublime text 2? Is it also the same? or no?

Any answer would be much appreciated.

Thanks in advance :D.

I guess sublime text is just an editor with good features for progammers. But any simple notepad is enough to write php code.

create text file name it as HelloWorld.php (or any name with extension as php)
open it and write following code

    <?php
    echo "this is php code";
    echo "Hello world";

    ?>
<h1> This is html code </h1>

<h2 > this is <?php echo "php embeded in html"; ?> </h2>

Save that file in your web root directory and open it with appropriate location in any browser.

url : http://localhost/anyfolder/anysubfolder/HelloWorld.php

Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.