File-Inclusion Statements
You can insert the content of a file into a PHP file before the server executes it, with the include() or require() function.
These two functions are used to create functions, headers, footers, or elements that can be reused on multiple pages.
include() Statement
The include() function takes all the text in a specified file and copies [...]
Also filed in
|
|
Looping Statements
Loops have as purpose to repeat a statement a certain number of times or while a condition is fulfilled.
The while Statement
The while statement specifies a condition that must be met before execution of its embedded code is terminated. Its syntax is the following:
while (expression) {
statements
}
In the following example, $count is initialized [...]
Also filed in
|
|
Control Structures
Control structures determine the flow of code within an application, defining execution characteristics such as whether and how many times a particular code statement will execute, as well as when a code block will relinquish execution control.
Conditional Statements
Conditional statements make it possible for your computer program to respond accordingly to a wide variety of [...]
Also filed in
|
|
String Interpolation
To offer developers the maximum flexibility when working with string values, PHP offers a means for both literal and figurative interpretation. For example, consider the following string:
The $boy jumped over the wall.\n
You might assume that $boy is a variable and that \n is a newline character, and therefore both should be interpreted accordingly.
Double [...]
Also filed in
|
|
String Interpolation
To offer developers the maximum flexibility when working with string values, PHP offers a means for both literal and figurative interpretation. For example, consider the following string:
The $animal jumped over the wall.\n
You might assume that $animal is a variable and that \n is a newline character, and therefore both should be interpreted accordingly. However, [...]
Also filed in
|
|
Constants
A constant is a value that cannot be modified throughout the execution of a program. Constants are particularly useful when working with values that definitely will not require modification, such as pi (3.141592) or the number of feet in a mile (5,280). Once a constant has been defined, it cannot be changed (or redefined) at [...]
Also filed in
|
|
Variables
Although variables have been used in numerous examples in this chapter, the concept has yet to be formally introduced. This section does so, starting with a definition. Simply put, a variable is a symbol that can store different values at different times. For example, suppose you create a Web-based calculator capable of performing mathematical tasks. [...]
Also filed in
|
|
PHP’s Supported Datatypes
A datatype is the generic name assigned to any data sharing a common set of characteristics. Common datatypes include Boolean, integer, float, string, and array. PHP has long offered a rich set of datatypes, and in this section you’ll learn about them.
Scalar Datatypes
Scalar datatypes are capable of containing a single item of information. [...]
Also filed in
|
|
You’re only two chapters into the book and already quite a bit of ground has been covered. By now, you are familiar with PHP’s background and history and have delved deep into the installation and configuration concepts and procedures. This material sets the stage for what will form the crux of much of the remaining [...]
Also filed in
|
|
Saturday, February 7, 2009
Choosing a Code Editor
While there’s nothing wrong with getting started writing PHP scripts using no-frills editors such as Windows Notepad or vi, chances are you’re soon going to want to graduate to a full-fledged PHP-specific development solution. Several open source and commercial solutions are available.
Adobe Dreamweaver CS3
Formerly known as Macromedia Dreamweaver MX, Adobe’s Dreamweaver CS3 [...]
Also filed in
|
|
Saturday, February 7, 2009
Installing IIS and PHP on Windows
Microsoft Windows remains the operating system of choice even among most open source–minded developers, largely due to reasons of convenience; after all, as the dominant desktop operating system, it makes sense that most would prefer to continue using this familiar environment. Yet for reasons of both stability and performance, deploying [...]
Also filed in
|
|
Saturday, February 7, 2009
Chances are you’re going to rely upon an existing corporate IT infrastructure or a third-party Web hosting provider for hosting your PHP-driven Web sites, alleviating you of the need to attain a deep understanding of how to build and administrate a Web server. However, as most prefer to develop applications on a local workstation or [...]
Also filed in
|
|
In many ways the PHP language is representative of the stereotypical open source project, created to meet a developer’s otherwise unmet needs and refined over time to meet the needs of its growing community. As a budding PHP developer, it’s important
you possess some insight into how the language has progressed, as it will help you [...]
Also filed in
|
|
CONTENTS
=================================================
Chapter 1..Introducing PHP
Chapter 1..Introducing PHP (History,PHP 4,PHP 5,PHP 6,General Language Features,Summary)
Chapter 2..Configuring Your Environment
Chapter 2..Configuring Your Environment (Part-1) (Installation Prerequisites,Downloading Apache,Downloading PHP ,Installing Apache and PHP on Windows,Installing Apache and PHP on Linux)
Chapter 2..Configuring Your Environment (Part-2) (Installing IIS and PHP on Windows,Installing IIS and PHP,Configuring FastCGI to Manage PHP Processes,Testing Your Installation,Configuring PHP,Configuring PHP [...]