SEO: Download Free software, Free Engineering Notes, The Infinite Info

What's New Here?

VARIABLES:
Variables represent data. For example,
The variable “city” holds the literal value “Kathmandu” when appearing in your script as: $city = “Kathmandu”;

Variables in PHP are represented by a dollar sign followed by the name of the variable.
PHP supports the basic data types of strings, integers, double precision floating point numbers, etc. Variables are not tied to a specific data type, and may take any of the data types.


OPERATORS:
Using different types of operators we values are assigned to variables. Different types of operators are as follows:
a. Arithmetic operator:
+, -, *, /, and % are assignment operators.
b. Assignment operator:
The basic assignment operator is (=) sign.
c. Comparison operator:
This operator is used to compare to values. Most of the comparison operators are:
== equal to
!= not equal to
> greater than
< less than
>= greater than or equal to
<= less than or equal to
d. Logical operator:
This operator allows your script to determine the status of the conditions. Mostly this operator is used in if.... else and while control statements.
Following are the logical operators:
! -> not
Example: !$x. This means TRUE if $x is not true.
&& -> and
Example: $x && $y. This means TRUE if $x and $y are true.
|| -> or
Example: $x || $y. This means TRUE if either $x or $y is true.

e. Increment or decrement operator:
This operator adds or subtracts from a variable.
Pre-increment: ++$x
It means increment by 1 and returns $x
Post-increment: $x++
It means return $x and then increment $x by 1
Pre-decrement: --$x
It means decrement by 1 and returns $x
Post-decrement: $x--
It means return $x and then decrement $x by 1
PHP (recursive acronym for "PHP: Hypertext Preprocessor").
PHP started out as a small open source project that evolved as more and more people found out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way back in 1994. Now it has version 4.0.3 with numerous improvements and refinements over the original release.
PHP is a server side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session tracking, even build entire e-commerce sites. It is integrated with a number of popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.


Common uses of PHP:

It performs system functions, i.e. from files on a system it can create, open, read, write, and close them.
It can handle forms, i.e. gather data from files, save data to a file, thru email you can send data, return data to the user.
You can add, delete, modify elements within your database thru PHP.
Access cookies variables and set cookies.
Using PHP, you can restrict users to access some pages of your website.
It can encrypt data.

Apple Users:

If you have OS X, then try these sites to get up and running with PHP:



What you're doing here is getting the apache server up and running, so that you can run PHP scripts offline. Pay particular attention to where files are stored, and to the "localhost" address.

Linux Users

There are quite a few sites out there to help Linux users get up and running with the Apache server and PHP. Here are three sites that are worth checking out:




If you know any better ones, we'd be interested in hearing from you!

Windows Users:


PHP is embedded in HTML. (You could have a file that contains
almost no HTML, but usually it's a mixture.) That means that in amongst your normal
HTML (or XHTML if you're cutting-edge) you'll have PHP statements like this:
<body >
<strong>How to say "Hello, World!"</strong>
<?php echo "Hello, World!";?>
<br>
</body>

NEXT TOPIC >>
2012 LEARN PHP BASICS. All Rights Reserved.
Designed by Theme Junkie, Converted by Uong Jowo