![]() If you are looking to master php and gain all the skills you need to become a top-notch full stack software development professional, Simplilearn’s Post Graduate Program In Full Stack Web Development is the ideal choice for you. You have learned how to set up the complete environment for PHP development and how to write and execute your first program in PHP.Ĭheck our next tutorial on the PHP Login form. This brings us to the conclusion of ‘Hello World’ in PHP article. As you can see, you have got the output for your first PHP program. Save the file and open your web browser and type “localhost” (Since our server is locally hosted) followed by the folder name that you created and hit enter.ĩ. In the above code, “echo” is used to print the string in front of it.Ĩ. Since PHP is embedded into HTML codes, write the following HTML code along with the PHP script. Create a file named “index.php” inside the demo folder.ħ. Locate to C:\xampp\htdocs and select the “demo” folder you created.Ħ. Now open Visual Studio Code and click on “open folder”.ĥ. Inside that “htdocs” folder, create a folder and name it anything suiting your project.Ĥ. Open the XAMPP folder and locate a folder named “htdocs” in it.ģ. By default, XAMPP is installed in the C:\ drive.Ģ. Open the directory where XAMPP is installed. Now that you have set up the environment for PHP and learned its syntax let’s move onto creating the Hello World program.įollow this step-by-step to create your PHP program:ġ. It starts with while the code goes in between.įor every PHP file, the default extension code is ".php".Ī PHP file usually contains HTML codes with PHP scripts embedded into them. PHP SyntaxĪ PHP script is very similar to how HTML codes are written. Now, have a look at the syntax for writing PHP scripts. ![]() Eg: Atom, Notepad etc.ĭownload the Visual Studio Code from the official website. You may also download any code editor of your choice. You will use Visual Studio Code as the code editor. Now, to write the code, you need a code editor. After installation, open the XAMPP control panel and start the Apache webserver. Download and install XAMPP from the official website.Ģ. XAMPP is also used to set up a MySQL database, which you will learn in the later sections.ġ. You will be mainly using it for creating a local web server for this tutorial. XAMPP is an open source software which stands for:
0 Comments
Leave a Reply. |