How to Start Using PHP?
You have two ways to get going: find a web host that offers PHP and database support, or set up a web server, PHP and a database on your own computer.
1. Use a Web Host With PHP Support
With a host that already runs PHP, there's no setup on your side. Write your .php files, put them in your web folder, and the server processes them for you. Support is common, too: PHP is free, so most hosting companies include it.
2. Set Up PHP on Your Own PC
When your server doesn't offer PHP, you have three things to install yourself: a web server, PHP, and a database such as MySQL. Step-by-step instructions are available on the official PHP site (php.net).
PHP Version
Not sure which version you're running? The built-in phpversion() function will tell you.
Example
Print the version number of your PHP installation:
Prompt
Write a PHP script that displays the current PHP version using the
phpversion() function.
Output: PHP script
index.php
<?php
echo phpversion();
?>