0 ratings0% found this document useful (0 votes) 88 views57 pagesPHP Notes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
(Comeinurt Ghat a
Wh
PUP
| Eeneral purpose scripting language especially suited to web development
+ PHI stands tor PLP hypertext preprocessor
© PHP isa server side Programming language that is embedded in HTML
© Pup
allows web developers to cr
session mana;
= this
ate dynamic contents that interact with database.
ent ete.
swith popular databases like MySQL
PUP is basically used for
PUP is open source
- postyreSQL., Oracle ete
developing web apps
Why PHP?
PHP runs on different OS platforms like
© Windows (WAMP)
© Linux (LAMP)
© MAC OS (MAMP)
PHP is an interpreted language,
PHP
‘5 compatible with almost all servers but the most used server is apache.
PUP
is open source so it is free to download and use
PHP is easy to use and widely used.
Characteristics of PHP.
© Efficiency
© Securi
© Flexibility
© Familiarity
Who are using PHP?
Many reputed domains are using PHP
Facebook
Yahoo
Wikipedia
WordPress
(0+ million other domains are using PHP
History of PHP
Versions:
PHP /FI 1.0 released in 1995
PHP /FI 2.0 released in 1997
PHP 3.0 released in 1998
PHP 4.0 released in 2000
PLP 5.0 released in 2004
PHP 5.3 released in 2009
PHP 7.0 released in 2014
eee reese
PHP@Info_Planet Compiled by: Prasad Neve - 8275331362 Page | 1fdvantsees Lely and free from cost. Itean be
nt advantage of PIP is that it's open source
eine ‘cb applications.
downloaded ny where and readily available to use for web appli
© It is platform independent, PHP based application
Linux and Windows. ete ,
© Application can easily be Hoaded which are based on PHP
Is mainly used due to its faster rate of loading ove!
programming language.
I has less leaming curv
familiar with C programming can easily work on PHP.
because it is simple and straightforward to use.
ns can run on any OS like UNIX,
and connected to database,
1 slow internet speed than another
Someone
© [vis more stable from a few years with assistance of providing continuous support to
Various versions,
ions.
sophisticated structure for event of web appli
© Ihelps in managing code easily.
It helps in reusing an equivalent code and no got to write lengthy code and
+ It has powerful library support to use various function modules for data
representation,
PHP's built-in database connection modules help in connect
trouble and time for development of web applications and content based
may be potential candidates for hire.
1g database easily reduce
S.
Popularity of PHP gave rise to various community of developers, a fraction of which
Flexibility makes PHP ready to effectively combine with many other programming
languages in order that the software package could use foremost effective technology
for every particular feature
Syntax of PHP:
A PHD script can be placed anywhere in the document.
A PHP script starts with
<2php
echo "Hello, World!";
>
echo is a command used in PHP to display anything on sereen,
Comment:
/IAhis is single line comment
# this is also single line comment
/* this is multi tine comment,
* can spread over thousands of lines */
PHP@Info_Planet Compiled by: Prasad Neve - 8275331362
Page | 2Des.
may vary during the
Variable is name given to memory location whose va
execution of program
Variables in a program are used to store some values or data that
program.
© Any
ariables declared in PHP must begin with a dollar sign (S), followed by the
variable name.
* A variable can have long descriptive names (like Sfactorial, Seven_nos) or short
ames (like $n or $f or $x)
* A variable name can only contain alphanumeric characters and underscores (ic.
‘az’. °A-Z°, “0-9 and *_’) in their name, Even it cannot start with a number,
* Assignment of variables is done with the assignment operator, “equal to (=)". The
Variable names are on the left of equal and the expression or values are to the right of
the assignment operator
* One must keep in mind that variable names in PHP names must start with a letter or
underscore and no numbers,
* PHD is a loosely typed language, and we do not require to declare the data types of
variables, rather PHP assumes it automatically by analyzing the values. The same
happens while conversion. No variables are declared before they are used. It
automatically converts types from one type to another whenever required.
* PHP variables are case-sensitive, i.e. $sum and $SUM are treated differently.
Constants
* A constant is an identifier (name) for a simple value. The value cannot be changed
during the script.
* A valid constant name starts with a letter or underscore (no § sign before the constant
name).
yntar
define(name, value, case-insensitive)
example:
<2php
1/ case-sensitive constant name
define("GREETING”, "Welcome to Softanic!");
echo GREETING;
>