Showing posts with label PHP Concepts. Show all posts
Showing posts with label PHP Concepts. Show all posts

Sunday, 17 July 2022

PHP Concepts

What is PHP?

PHP stands for "PHP: Hypertext Preprocessor". Initially it was called "personal home page"
PHP is an opensource.PHP cost nothing, it is free to download and use
PHP is a scripting language designed for web.
PHP works with the web server. Ex: Apache, IIS, nginx etc which means that PHP scripts, or programs, usually run on a Web
PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl. So if you have experience with this language, you will be comfortable with php
PHP is a one of the most popular Web programming languages. Using PHP we can build dynamic, interactive Web sites

Syntax

See the below table to get the opening and closing tags of php
Opening TagClosing Tag
<?php?>
<??> (Short Tag)
<script language='php'></script>

PHP File

PHP document with an extension of .php
PHP file contains HTML, CSS, javascript, user text, and php code
PHP code is parsed on the server. This method of code execution is called "Server Side Code".
Note: When code is executed in the browser We call that "Client-Side Code".Ex. Javascript
PHP statement ends with a semicolon(;)

PHP Works

PHP parser finds the requested file and scans it for php code.
When the PHP parser finds PHP code, it executes that code and sends back the output to a web server
Webserver sends it to a web browser and web browser displays the output on the screen


Evolution Of PHP

PHP was created by Rasmus Lerdorf way back in 1994. He released PHP to the general public in 1995 and called it PHP version 2
In 1997, two more developers, Zeev Suraski and Andi Gutmans rewrote most of PHP and, along with Rasmus, released PHP version 3.0 in June 1998.
The new version, PHP 4, was launched in May 2000.
PHP 5, released in July 2004

PHP Advantages

It is easy to learn
It is fast
It is inexpensive. (Free)
It is easy to use
PHP is cross-platform. It can run on many operating systems. Linux
Mac
Windows
Unix
Solaris
It is secure
It is designed to support databases-SQL
Mysql
Oracle
PostgreSQL
SQLite
IBM DB2
and More
It contains an Object-Oriented concept

PHP Comments

Generally, Comments in programming can remind you of what you were thinking when you wrote the code. A comment in a PHP code is used to understand the program works step by step and then Who created, Who Edited, last modified date, etc. A comment is simply text that is ignored by the PHP engine.

  1. <?php // This is a single line comment # This is also a single line comment /* This is a multiple lines comment This is a multiple lines comment */ ?>











Microsoft Thwarts Chinese Cyber Attack Targeting Western European Governments

  Microsoft on Tuesday   revealed   that it repelled a cyber attack staged by a Chinese nation-state actor targeting two dozen organizations...