0% found this document useful (0 votes)
57 views9 pages

PHP 2nd Lecture

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 9

PHP ( theory + programming )

playlist for
Diploma
Lec - 2
CHAPTER 1 -( PART 1 )
What is PHP ?
PHP, originally standing for "Personal Home Page," is a widely used open-source server-side scripting language. It is particularly well-

suited for web development and can be embedded into HTML code. PHP is known for its simplicity, flexibility, and ease of

integration with databases, making it a popular choice for building dynamic and interactive websites.

and many more . .


Chapter 1 : Expressions & Control Statements in PHP
History , Advantages of PHP , Syntax of PHP
Variables , data types
Operators
Decision making ( if else & switch )
Continue & break
Looping

Today’s session :

History , Advantages of PHP , Syntax of PHP


Variables , data types
History of PHP
1. Origins (1994-1995): PHP was created by Rasmus Lerdorf in 1994 as a set of Common Gateway Interface (CGI) binaries written in the C
programming language. Initially, it was a collection of scripts that Rasmus used to track accesses to his online résumé.

2. Personal Home Page Tools (PHP Tools) (1995): Rasmus released the source code for PHP Tools, and other developers started
contributing to its development. This marked the beginning of PHP's evolution as a scripting language.

3. PHP/FI (Personal Home Page/Forms Interpreter) (1995-1997): Zeev Suraski and Andi Gutmans, two Israeli developers, rewrote the PHP
parser and formed the base for PHP 3 (PHP/FI 2). PHP 3 was a complete rewrite, gaining more popularity and features. In 1997, PHP 3 was
released.

4. PHP 4 (2000): PHP 4 brought significant improvements, including support for object-oriented programming, better support for
databases, and enhanced performance. This version solidified PHP's position as a powerful web development language.

5. PHP 5 (2004): PHP 5 introduced many new features, including the Zend Engine 2 (the scripting engine that powers PHP), improvements
to object-oriented programming, and the introduction of the SimpleXML extension. PHP 5 was a major step forward in terms of both
functionality and performance.

6. PHP 6 (Development Abandoned): The PHP community had plans for PHP 6, which aimed to include native Unicode support. However,
due to various technical challenges and delays, development on PHP 6 was eventually abandoned.

7. PHP 7 (2015): PHP 7 was a significant milestone in the language's history. It brought substantial performance improvements, a more
consistent and secure engine, and many new features. PHP 7 has become the standard for many web applications.

8. PHP 8 (2020): PHP 8 introduced several new features and improvements, including the Just-In-Time (JIT) compiler, union types, named
arguments, attributes, and more. PHP 8 continued to enhance the language's capabilities and performance.
Advantages of PHP

1. Open Source: PHP is an open-source language, which means it is freely available for use, modification, and distribution. This has
contributed to a large and active community of developers, fostering collaboration and continuous improvement.

2. Ease of Learning and Use: PHP has a simple and easy-to-understand syntax, making it accessible for beginners. It is particularly friendly
to developers with a background in C-style languages, and many resources, tutorials, and documentation are available for learning.

3. Platform Independence: PHP is platform-independent, meaning it can run on various operating systems, including Windows, Linux,
macOS, and others. This flexibility allows developers to choose the environment that best suits their needs.

4. Integration Capabilities: PHP can easily integrate with different databases, including MySQL, PostgreSQL, Oracle, and more. It also
supports various protocols such as HTTP, LDAP, IMAP, and others, making it versatile for different types of web development projects.

5. Wide Community Support: PHP has a vast and active community of developers, which means abundant resources, forums, and
community-driven support. This is beneficial for problem-solving, sharing knowledge, and staying updated on best practices.

6. Frameworks and CMS Support: PHP has several robust frameworks and content management systems (CMS) like Laravel, Symfony,
CodeIgniter, and WordPress. These tools provide pre-built modules, security features, and other functionalities, speeding up development
and ensuring code consistency.

7. Scalability: PHP can handle scalable web applications. When properly structured and optimized, PHP applications can scale horizontally
by adding more servers to handle increased traffic and load.
Syntax of PHP

PHP code is typically enclosed within <?php and ?> tags.

The short form <? and ?> is also valid, but it may not be enabled on all servers for security reasons.
Variables in PHP

Variable names in PHP are case-sensitive, so $name and $Name are different variables.

Variable names must start with a letter or underscore ( _ ).

After the first character, a variable name can contain letters, numbers, and underscores.
Data types in PHP

PHP is a dynamically typed language, which means that the data type of a variable is determined at runtime based on the value it

holds.

Integer
Double
String
Boolean
Thank You .
see you in next lecture . . .

You might also like