January 19, 2009

PHP Variable Types : Scalar Type Variables

php variables type

php variables type

PHP supports eight primitive types.

Four scalar types:
1. Boolean
2. Integer
3. Float (floating-point number, aka ‘double’)
4. String

Two compound types:
1. Array
2. Object

And finally two special types:
1. Resource
2. NULL

Booleans (A value that can only either be true or false)

This is the easiest type. A Boolean expresses a truth value. It can be either TRUE or FALSE.
Syntax
To specify a boolean literal, use either the keyword TRUE or FALSE. Both are case-insensitive.
[lang] $foo = True; // assign the value TRUE to $foo
?>
[/lang]
More on PHP Variable Types : Scalar Type Variables

Permalink Print 7 Comments

January 8, 2009

What is PHP?

What is PHP?

What is PHP?

The term “PHP” is actually a “recursive acronym” that stands for PHP: Hypertext Preprocessor. It might look a bit odd, but it is quite clever, if you think of it. PHP is a “scripting language” - a language intended for interpretation and execution rather than compilation such as, for example, C.

The fact that PHP is interpreted and not compiled, however, does not mean that it is incapable of meeting the demands of today’s highly intensive web environments—in fact, a properly written PHP script can deliver incredibly high performance and power.

What can PHP do?

PHP is mainly focused on server-side scripting, so you can do anything any other CGI(*) program can do, such as collect form data, generate dynamic page content, or send and receive cookies. But PHP can do much more.

There are three main areas where PHP scripts are used.

Server-side scripting:

This is the most traditional and main target field for PHP. You need three things to make this work. The PHP parser (CGI or server module), a web server and a web browser. You need to run the web server, with a connected PHP installation. You can access the PHP program output with a web browser, viewing the PHP page through the server. All these can run on your home machine if you are just experimenting with PHP programming.
More on What is PHP?

Permalink Print 4 Comments