Even if you never seen what PHP looks like, you still don't need to focus on reading books and lenthy know-hows. Once you get to grips with the fundamentals, you don't need board prep either.
At the same time, it would be headlong to dive into the coding process without any prior studying.
Yep, any coding language is better learnt in practice, yet it's essential to know the basics.
With that being said, start your reserch with the PHP official website. It provides a great and digestible overview which should be enough to grasp the language fundamentals, even if have no programming experience whatsoever.
Once you've hit the grindstone, you're good to head out into the PHP practice.
Now it’s time to write some PHP code.
Basically, you require only 2 things for this: a development environment to run your PHP scripts and a code editor to write the code.
1. Install a local development environment
First of all, you need an interpreter to make sense of your code and run it (since PHP is a scripting language).
Where do you write code? Development environment. A DE is usually a single program in which all development is done. It usually contains many functions for creating, modifying, compiling, deploying and debugging software. The purpose of the development environment is to abstract the configuration needed to combine the command line utilities into a single module, which will reduce the time to learn the language and increase developer productivity.
Try each development environment and see which platform you feel most comfortable with:
Code editors for PHP projects
Visual Studio Code;
If you’re not sure which one to go with, try XAMP. It's an easy to install and easy to use Apache distribution containing MySQL, PHP, and Perl.
2. Install a code editor
A code editor is aт editor for creating and editing program source code. It can be a standalone application or embedded in an integrated development environment (IDE).
3. Start coding
Run your IDE, open a browser and type localhost in the URL bar.
You will see the DE’s homepage.
Your PHP scripts must be inserted inside a directory aka webserver root.
<pre>Now open your code editor and paste the following PHP code:
echo '<h1 style="text-align: center;">Hello World!</h1>';
Save the file inside the htdocs directory as hello_world.php (you can use any file name you want, just be sure to use the .php extension), then go back to your web browser and open the URL: