php tutorial


  • WatchBeginner PHP Tutorial - 1 - Introduction to PHP
  • WatchBeginner PHP Tutorial - 2 - Installing XAMPP Part 1
  • WatchBeginner PHP Tutorial - 3 - Installing XAMPP Part 2
  • WatchBeginner PHP Tutorial - 4 - Creating Your First PHP File
  • WatchBeginner PHP Tutorial - 5 - Writing Your First PHP File
  • WatchBeginner PHP Tutorial - 6 - The phpinfo Function
  • WatchBeginner PHP Tutorial - 7 - The php.ini File
  • WatchBeginner PHP Tutorial - 8 - Indentation
  • WatchBeginner PHP Tutorial - 9 - echo
  • WatchBeginner PHP Tutorial - 10 - print
  • WatchBeginner PHP Tutorial - 11 - Output HTML Using echo/print
  • WatchBeginner PHP Tutorial - 12 - Embedding PHP Inside HTML
  • WatchBeginner PHP Tutorial - 13 - comments
  • WatchBeginner PHP Tutorial - 14 - Error Reporting
  • WatchBeginner PHP Tutorial - 15 - More on Error Reporting
  • WatchBeginner PHP Tutorial - 16 - Variables
  • WatchBeginner PHP Tutorial - 17 - Concatenation
  • WatchBeginner PHP Tutorial - 18 - if / if else Statement
  • WatchBeginner PHP Tutorial - 19 - if / else if Statement
  • WatchBeginner PHP Tutorial - 20 - Assignment Operators
  • WatchBeginner PHP Tutorial - 21 - Comparison Operators
  • WatchBeginner PHP Tutorial - 22 - Arithmetic Operators
  • WatchBeginner PHP Tutorial - 23 - Logical Operators
  • WatchBeginner PHP Tutorial - 24 - Triple Equals
  • WatchBeginner PHP Tutorial - 25 - while Loop
  • WatchBeginner PHP Tutorial - 26 - do while Loop
  • WatchBeginner PHP Tutorial - 27 - for Loop
  • WatchBeginner PHP Tutorial - 28 - switch Statement
  • WatchBeginner PHP Tutorial - 29 - die and exit Functions
  • WatchBeginner PHP Tutorial - 44 - Expression Matching
  • WatchBeginner PHP Tutorial - 30 - Basic Functions
  • WatchBeginner PHP Tutorial - 31 - Functions with Arguments
  • WatchBeginner PHP Tutorial - 32 - Functions with a Return Value
  • WatchBeginner PHP Tutorial - 33 - Global Variables and Functions
  • WatchBeginner PHP Tutorial - 34 - String Functions Part 1
  • WatchBeginner PHP Tutorial - 35 - String Functions Part 2
  • WatchBeginner PHP Tutorial - 36 - String Functions Part 3
  • WatchBeginner PHP Tutorial - 37 - String Functions Part 4
  • WatchBeginner PHP Tutorial - 38 - Introduction to Arrays
  • WatchBeginner PHP Tutorial - 39 - Associative Arrays
  • WatchBeginner PHP Tutorial - 40 - Multi-dimensional Arrays
  • WatchBeginner PHP Tutorial - 41 - for each Statement
  • WatchBeginner PHP Tutorial - 42 - include and require Functions
  • WatchBeginner PHP Tutorial - 43 - include_once and require_once
  • WatchBeginner PHP Tutorial - 45 - More on Expression Matching
  • WatchBeginner PHP Tutorial - 46 - String Functions: String Length
  • WatchBeginner PHP Tutorial - 47 - String Functions: Upper / Lower Case Conversion
  • WatchBeginner PHP Tutorial - 48 - String Functions: String Position Part 1
  • WatchBeginner PHP Tutorial - 49 - String Functions: String Position Part 2
  • WatchBeginner PHP Tutorial - 50 - String Functions: Replacing Part of a String

What is PHP?

PHP is a worldwide used open source and free server scripting language. PHP stands for Hypertext Preprocessor. It is widely used for web development of both dynamic and interactive web pages. The best part is PHP can be embedded into HTML. If you are unfamiliar, then Facebook, Google and Yahoo are all created with the help of PHP.

What is the course all about?

This course will give you an insight into how to learn PHP from scratch.

Audience:

The target audience for PHP tutorial for beginners is computer programmers with limited knowledge of PHP and related languages.

Well, if you now talk about PHP. Then, PHP language has been improved with a number of improvements. The latest in the PHP house is PHP 7. So, we will majorly focus on PHP 7 tutorial.

Step By Step PHP 7 Tutorial:

Step 1: Getting Started with PHP:

The first step is to setup a local server. For executing a PHP script on the web server, you will require a running PHP webserver. So before writing any PHP code, you will need the following installed in your PC.

The Apache Web server
The PHP engine
The MySQL database server

You can install them individually or purchase a preconfigured package for your OS. Well, the popular and easily available ones are XAMPP or Wampserver. Start by installing XAMPP or WampServer on your system. This will help you build web applications based on a PHP code. Some basic skills and knowledge of CSS and HTML are going to be great to learn PHP.

Step 2: Learning PHP Syntax

A PHP Syntax is quite simple. The PHP script starts and ends with tag. With PHP in between. Look at the example:

The use of this syntax clearly tells the PHP engine that the enclosed code is a PHP code instead of a simple HTML code. A PHP statement is closed with a semicolon, which clearly states that the current statement has ended.

Step 3: Creating Your First PHP Script

Once you have successfully installed the XAMPP or Wampserver on your system. Let’s learn how to create a simple PHP script displaying “Welcome to PHP Tutorial” in the browser. We will be using the WampServer to complete this task.

Click the WampServer icon from your windows taskbar.

Choose the “www directory.” You can also choose the “www” directory by navigating through the C:\wamp\www.
Create a subdirectory within the main directory by the name “Test Project.”
Open up your favorite code editor, e.g. Netbeans, Eclipse, PHPStorm, etc.
Create a new PHP file.
Type the following code:
// Display greeting message
echo “Welcome to PHP Tutorial”;
?>
Save the file by testfile.php in your project folder.
Check the output in the browser by visiting URL: http://localhost/project/testfile.php.

Step 4: Understanding PHP Error Messages

If you have skipped anything in the entire syntax. Then, you are bound to get an error. An error that looks something like this:
Parse error: parse error in C: Inetpubwwwrootwebtestfile.php

You may also like...