What is PHP?

Introduction to PHP

PHP is an open-source server-side programming language, also called the use scripting language, embedding the code of PHP into the code of API HTML. The full form of PHP is Hypertext Preprocessor, its original name is Personal Home Page. It was created by Ramsum Lerdorf in 1994.

Php runs on all platforms like Windows, Linux, Unix, Mac, OS, Etsy.

PHP file ka extension .php

What we can do with PHP?

-Can create dynamic pages with PHP.
-Handle button click, radio button:-
Through PHP you can handle the button click event
-Create database application
-client/server application
-Student Registration
-online course
-online shopping cart
-chat rooms

EXAMPLE:-

<!DOCTYPE html>
<html>
<body>

<?php
	echo"Helllo World";
?>

</body>
</html>

What are client and server?

Client

A client is a piece of computer hardware or software that accesses a service made available by a server. For example, web browsers are clients that connect to the web servers and retrieve web pages for display.

Server

A server is a computer program or a device that provides functionality for other programs or devices, called “client”.

There are many servers like: web server, mail server, print server etc.

Client-server Architecture

Client server Architecture:-

2-Tier Architecture:- A 2 Tire Architecture is where the client talks directly to a server.

3-Tier Architecture:- Middleware

If the client has sent the request to the application server, the application server checks that the request is made by the client. If the request is in its data source, then that application server will respond to your request.

Web Browser and Web Server

Web Browser

The web browser is a client, program, software, or tool through which we sent HTTP requests to a web server. It knows how to communicate whit the server. The main purpose of a web browser is to locate the content on the World wide web and display the web page, images, audio, or video form.

Web Server

A web server can be either a software unit or a hardware unit, which provides the web pages via HTTP. The web server gets the request and finds the resources than the response to the client. The web server provides service only for web applications. All the communication between client (web browser) and server takes place via HTTP.

Web server architecture

Web application

A web application or web app is a client-server software application in which the client runs in a web browser.

What is a Website?

Website is a collection of related web pages that may contain text, images, audio, and video. A website can consist of one page, depending on what the site owner is trying to accomplish.

Tagged : / / / / /

What is php? Define variables and Datatypes how to use it?

In this tutorial i’m going to explore about what is PHP and their datatypes and how to use of variables.
PHP is a open-source side programming language that is specially suited for web development and can be embeded to HTML. It is powerful to hold a content management system like WordPress and can be used to control user access. PHP can actually do anything related to server-side scripting or more popularly known as the backend of a website, it is more secure and reliable to be used as a server-side scripting language.

What is DataTypes?

Datatypes is a range of all different data can be given variable in PHP. It’s supports these string.

  1. String
  2. Integer
  3. Float (floating point numbers – also called double)
  4. Boolean
  5. Array
  6. Object
  7. NULL
  8. Resource

How to write datatypes in PHP?

  1. string:- string is a data type used in programming, string is a sequence of character its supports a 256-character. The simplest way to create a string is to enclose the string literal (i.e. string characters) in single quotation marks (‘), like this:

    $my_string = ‘Hello World’;

2. Integer:- An integer is a number without any decimal part.

<?php  
    $x=123;  
    echo $x;  
?>  

3. Float:- A float is a number with a decimal point as like- 2.0, 256.4, 10.358, 7.64E+5, 5.56E-5 are all floats

4. Boolean:- A boolean data can be either TRUE or FALSE. These are predefined constants in PHP.

var_dump((bool) -2);        // bool(true)
var_dump((bool) "foo");     // bool(true)
var_dump((bool) 2.3e5);     // bool(true)
var_dump((bool) array(12)); // bool(true)
var_dump((bool) array());   // bool(false)
var_dump((bool) "false");   // bool(true)


5. array:- An array stores multiple values in one single variable.

<?php
$cars = array(“Volvo”,”BMW”,”Toyota”);
var_dump($cars);
?>

6. Object:- Objects are the instances of user-defined classes that can store both values and functions. They must be explicitly declared.

7. Null:- Null is a special data type which can have only one value Null, if variable is created without a value it is automatically assigned a value of Null.

8. Resource:- Resources are not the exact data type in PHP. Resource is the storing the refrenece to functions call or refrences to external PHP resource as like database.

Tagged : / / /