Notice: This might not be different in the newest versions of NetBeans
The aim of this tutorial is to show you how to write a "Hello World" program in PHP, and we'll be using the NetBeans IDE 8.1. If you are new to PHP, then I bet this will be of help to you. Enjoy!Basic software requirements
1. NetBeans IDE: I'll be using version 8.1, you can download

2. WampServer: Download

3. A browser: You can use any browser of your choice
Step 1: Open NetBeans
Step 2: Goto File >> New Project or simply press Crtl+Shift+N. Under "Categories" by the left of the window, select "PHP". Then under "Projects" select "PHP Application".
Now click "Next >" .

Step 3: Give the project a project name of your choice, I'll use "Hello_World" (avoid white spaces).
Note: For the Source Folder, browse and search for the "www" directory in the "wamp" folder in the C drive and click Open. Type the name of the project again after the C:\wamp\www\ .
Click on "Finish".

You will see the newly created project in the "Projects" window.
By default, the index.php file is created. We will be using that file.

Step 4: Inside the PHP block (<?php ?>), type:
echo "Hello World";
The Run the file. You should see Hello World on your browser.

You can also try the codes below to give us the same result:
1. print_r("Hello World");
2. echo "Hello". "World";
3. $welcome = "Hello World";
echo $welcome;
4. $greeting = "Hello";
echo $greeting."World";
Hope you got it. Thanks!
The Run the file. You should see Hello World on your browser.

You can also try the codes below to give us the same result:
1. print_r("Hello World");
2. echo "Hello". "World";
3. $welcome = "Hello World";
echo $welcome;
4. $greeting = "Hello";
echo $greeting."World";
Hope you got it. Thanks!
Comments
Post a Comment