Professional Documents
Culture Documents
PHP Is Easy To Learn
PHP Is Easy To Learn
PHP Is Easy To Learn
The programming language called PHP is quickly rising to be one of the most
preferred web browser programming languages due to its user-friendliness,
efficiency, and user control. PHP allows a user to describe specific functions
within the code in order to drastically control the way a web browser displays
and organizes information. A user is able to mix PHP and HTML within the
same document to reach the desired effect.
WHY PHP
Many
programming
languages
are
complex
and
PHP allows
users
to their exact
ratings
than
other
programming
languages do. PHP is fast, efficient, and works great in almost any web
browser as well as integrating into almost any server. A user is able to
add a few lines of code to a PHP document, click save, and watch their
website transform into a more powerful and more organized version of
itself. PHP documents are high in demand because they compete with
almost all other programming languages available. PHP is also quickly
growing in its capabilities and offers more features as well as better
operating standards every day.
PHP Is Free
Another reason that PHP is preferred among users is that it is entirely
free. While many other programming languages require that the user
obtains expensive programs and pays for support files, PHP is open to
anyone, anywhere, and any time. A beginner in PHP does not have to
worry about finding support for their interest in programming and web
HISTORY
PHP as its known today is actually the successor to a product named PHP/FI created
in 1994 by Ramus Lerdorf, the very first incarnation of PHP was a simple set of
common Gateway Interface (GCI) binaries written in the C programming language.
Originally it is used for tracking visits to his online resume, he named the suite of
scripts PERSONAL HOMEPAGE.
In June 1995, Ramus released the source code for PHP tools to the public, which
allowed developers to use it as they saw fit and it also allowed users to encourage
and to provide fixes for bugs in the code, and to generally improve upon it.
Hypertext Preprocessor:: PHP some time I used to call Personal Home Page PHP is
an open source server side scripting language that mainly used for developing web
applications and web services, but is also used as a general purpose programming
language.
PHP code is usually processed by a PHP interpreter implemented as a module in the
web server or as a common gateway interface (GCI) PHP code may be embedded
into HTML code, or it can be used in combination with various web template
systems, and web framework. PHP code is usually processed by a PHP interpreter
implemented as a module in the web server. Over time, more functionally was
desired and Ramus rewrote PHP tools, producing a much larger and richer
implementation. This new model was capable of database interaction and more,
providing a framework upon which users could develop simple dynamic web
application such as guestbook.
can
can
can
can
can
can
can
SEQUENCING
uses
incremental
integer
keys,
with
the
exception
of
few
This can occur for example when the schema defines maxOccurs>1 on a
element which is a complex Type with a choice order indicator.
The examples below assume an SDO created with the following schema and
instance information, using the XML Data Access Service.
The schema below describes the format of a letter. The letter can optionally
contain three properties; date, firstName, and lastName. The schema states
mixed="true" which means that unstructured text can be interspersed
between the three properties.
The following is an instance letter document. It contains the three letter
properties; date, firstName and lastName, and has unstructured text
elements for the address and letter body.
.
SELECTION FEATURES
conditions.
Switch statement select one of many blocks of code to be executed.
Assignment operator
Arithmetic operator
Comparison operators
Incrementing/decrementing operator
Logical operators
Bitwise operatorsabili
Assignment operator
Much like c/c++, PHP includes combined assignment operators, which aid
writty
Example of an assignment operator (=)
Example
$a = $b
$a += $b
$a .= $b
Result
Set b to be same value as a
Equivalent to $a=$a+$b
Equivalent to $a=$a . $b
Arithmetic operators
PHP has a basic arithmetic operator that are effective on numeric data types
are;
Operand
Operator
+
Addition
_
Subtraction
*
Multiplication
/
Division
%
Modulus
.
Concatenation for strings
String is an extremely important useful operation since PHP mostly deals
with strings
Comparison operators
These operators or expressions return a value of true (or 1) and/or false
(or0).
Operand
==
!=
<>
<
>
<=
>=
Operators
Equal
Not equal
Not equal
Less then
Greater than
Less than or equal to
Greater than or equal to
Incrementing/decrementing
Example
++ $a
$a ++
--$a
$a --
Name
Pre-increment
Effect
Increment by 1 then
Post-increment
return $a value
Return $a value then
Pre- decrement
increment by 1
Decrease $a value by 1
Post-decrement
then return $a
Return $a then
decrease $a value by 1
Logical operators
Example
And
Or
Xor
!
&&
!!
STRENGHT OF PHP
Name
And
Or
Xor
Effect
True if both are true
True if either is true
True if either is true
Not
And
Or
1. Supports.
Database connectivity PHP can access many different databases including
MySql, Oracle, and MS Access. Supports sessions. Since PHP is so popular and
widely used, finding help or documentation for PHP online is extremely easy.
The best part is the support is free through forums, PDFs, blogs, and social
media. The fact that its open source also contributes to the large support
community of PHP and LAMP (Linux, Apache, MySQL, and PHP) in general.
PHP has the largest user base of any scripting language.
PHP also has support services using protocols such as LDAP, IMAP,
SNMP, NNTP, POP3, HTTP, COM (on Windows)PHP has extremely useful
text processing features, from the POSIX Extended or Perl regular
expressions to parsing XML documents. For parsing and accessing XML
documents, PHP 5 standardizes all the XML extensions on the solid
base of libxml2 and extends the feature set adding SimpleXML and
XMLReader support.Easy deployment and cost effective hosting
2.
3.
4.
5.
6.
7.
8.
Unique session generation. PHP can generate unique session IDs. The ID
follows the user during a single session on a web site. This simplifies creating
shopping cart applications and tracking user's behaviors.
Eliminates client configuration problems. With PHP there is no need to
worry if the client has the appropriate software installed, since the application
is executed on the server.
Reduces development time. Even a newcomer can begin developing PHP
applications in hours. Yet PHP contains many advanced features for
professional programmers.
Maintains source code security. The user does not see your source code
as they do with JavaScript.
Simple and easy to learn PHP scripting is definitely one of the easiest, if
not the easiest scripting language to learn and grasp for developers. This is
partially due to the similarities which
PHP syntax has with C and Java. Even if the only knowledge of development
that you have is with HTML, picking up PHP is still fairly easy. For developers
just starting out, PHP is often the first scripting language they learn because
its clear and easy to understand.
Freedom When comparing PHP to a language such as ASPX, the level of
freedom you get is far superior. PHP is open source. You can use any text
editor in order to code PHP such as Notebook++, jEdit, Emacs, Bluefish, or
even just Notepad if you feel inclined. If you want to develop applications
with ASPX, youre going to be limited to Microsoft Visual Studio. Restrictions
are never a good thing, especially with coding. PHP also isnt OS specific. You
can run PHP on: Linux, Mac OSX, Windows, UNIX other than ASP,
ASP.NET,JSP etc.
Free. There are no costs associated with using PHP including updates.
Keeping costs down is a goal of any business and developers as well. So the
fact that you can code programs with PHP for free is a huge benefit that you
wont get with JPS, ASP, or other scripting languages that require paid
hosting. There are no licenses, restrictions, or royalty fees involved at all. PHP
is 100% free for anyone to use.
9. Integration PHP is used for so many web applications and actually powers
over 30% of the web. Systems such as MongoDB, Memcache, and Pusher all
integrate with PHP. Almost any industry you can think of uses PHP
applications in some fashion including banks,hospitals, government, and
large corporations.
10. Frameworks Almost every benefit of PHP seems to go back to the fact that
the community is so large. The number of PHP frameworks available is even
further proof of how strong the PHP community is. Whether youre looking for
database access libraries, session management, or code reuse, you will have
no problem finding PHP frameworks to give you a helping hand. Some
popular PHP frameworks include: Aiki, Symfony, Zend, Silex, Slim
11. Easier to fix problems When it comes to web application development,
youre bound to run into issues and come across the occasional, fail. But the
benefit you get with PHP is that problems arent as difficult to find and fix as
they are with other languages. This is because with each request, PHP cleans
up and starts over. So an issue with one request will not necessarily disrupt
another.
12. Scalability In the world of IT, the word scalability is like gold. Whether you?
re dealing with databases, hosting, or in this case, programming, scalability is
never a bad thing. Due to the way PHP is built, you can easily increase your
cluster size by adding more servers as your projects row.
13. Object Oriented PHP actually has the ability to call Java and WindowsCOM
objects. In addition to this, you can create custom classes. Other classes can
actually borrow from those custom classes as well which extends the
capabilities of PHP even further.
14. Speed. since PHP does not use a lot of a systems resources in order to run,
it operates much faster than other scripting languages. Hosting PHP is also
very easy and lot of hosts provide support for PHP. Even when used with
other software, PHP still retains speed without slowing down other processes.
Being that PHP is a mature language, it is also fairly stable because all the
kinks have been worked out over the years.
15.Embedded code. With PHP you write HTML script with embedded code
delineated with special start and end tags. The embedded code is executed
on the server and then sent to your browser. What is displayed in the browser
is the result from the code's execution. This is very different from other
scripting languages like Perl and C where code is written to output HTML
commands. While similar to JavaScript, the main difference with PHP is the
code is executed on the servers,whereas with JavaScript the code is executed
on the client-side. With JavaScript it is possible to determine the underlying
code, whereas with PHP the underlying code is hidden from the user.
Important Critique of PHP include:
Client side scripting. Since PHP is a server side language, the programs cannot be
executed on the client. Thus the server might be slowed down while multiple PHP
applications are executed.
Error Handling. Error handling in PHP is still primitive. However you can code your
way around most problems. Since PHP is a server side language, the programs
cannot be executed on the client. Thus the server might be slowed down while
multiple PHP applications are executed.
<style>
div{
font-family: Times new roman;
font-size: 25px;
color: red;
}
</style>
<?php
$n1=$_POST['sn'];
$sum = 0;
echo "<div>";
for($i=2;$i<=$n1;$i++)
{
if($i==2 || $i==3 || $i==5 || $i==7){
echo " $i ";
}
// all divisible factors.
elseif(($i%2)!=0 && ($i%3)!=0 && ($i%5)!=0 && ($i%7)!=0)
{
echo " $i";
$sum += $i;
}
else
continue;
}
echo "are prime numbers between 1 and $n1.<br>";
echo "sum:" . $sum;
echo "</div>";
?>
GROUP 2
NANLOP MIMANG PATIENCE - PLASU/2012/NAS/0027.
JOSHUA .P.JOSEPH - PLASU/2012/NAS/0072.
DINFA SAMUEL NASARA - PLASU/2013/FNS/0077.
YILDAM BLESSING NANSIK - PLASU/2012/NAS/0036.
MIKAN NIAPSUK CORNELIUS PLASU/2012/NAS/0028.