PHP Tutorials by VIA
Note: if you like classroom training then you can visit our PHP Training at VIA
PHP “Hypertext Preprocessor” is a very easy server side scripting language. It is easily understandable and and fast to implement. It is first server side scripting language which was embedded with HTML. This is the reason of PHP being so popular within last 2-3 years. There are many PHP tutorials available on the Internet which are free. Vedant IT academy gives you the Best PHP tutorials which are very easy to understand with basic logic used. To start with PHP programming you need to install server to your computer to run the php script. So lets start with it.
PHP tutorial 1:
Download the software uitable for your computer system (32 bit or 64 bit). Install it as per the instructions given in the manual. Once you complete the installation, check for the php ini in your browser. For that follow the steps below.
- Create the file in the public directory of your server i.e. foe example if you have installed Wamp in your C drive then it comes as C -> wamp -> www. “www” is the root directory and you will store all your projects in this directory.
- So now create a file named index.php and have a code in it as
- In the browser type url as localhost/index.php This is will you all the information about configurations having in php version. This is how your installation has been successfully done. 🙂
Now let’s say Hello world!!!
Make another file in www folder with a name say ‘helloWorld.php‘. open it with your favorite text editor. I use sublime editor and would suggest you to go for that. 😉 . in helloWorld.php we will write as
The output of the script in your browser will be Hello, World! If you do the view sourcode you’ll find that browser doesn’t show php code. all it gives is a pure HTML. While writing the code for php it should be covered in your code ?>tags. There are other tags even like php code ?> and alse . The standard one is
PHP tutorial 2: Variable, Constants
The variables are declared by sign of ‘$’ in starting. PHP is loosely type casting language so we don’t declare their data types. They are assigned value by using assignment operator ‘=’ and value on right side. They take the most recent value assigned.
Constants are nothing but the name or identifier whose value remains constant throughout the script once defined. They are case-sensitive, and conventionally are defined in uppercase.
examples of constants
// Valid constant names
define(“ONE”, “first thing”);
define(“TWO2”, “second thing”);
define(“THREE_3”, “third thing”)
// Invalid constant names
define(“2TWO”, “second thing”);
define(“__THREE__”, “third value”);
Examples of variables.
$true_num = 3 + 0.14159;
$true_str = “Tried and true”
$true_array = “An array element”;
$false_array = array();
$false_null = NULL;
$false_num = 999 – 999;
$false_str = “”;
PHP tutorial 3:
Programs rarely works perfect for first time. Many things may get wrong while writing code. Syntax error, undefined variable error etc. To get the error messages in browser set the display_errorsKeep log_errors on, to send errors to the web server error log.
There are many topics come under the PHP Tutorials. For more tutorials please visit Vedant IT Academy
Hope these Tutorials are helpful to you. Enjoy learning php and see every updated PHP tutorial here. Thanx and all the best guys. 🙂