| |
| |
Introduction | |
| |
| |
I Using PHP1 PHP Crash Course | |
| |
| |
Before You Begin: Accessing PHP | |
| |
| |
Creating a Sample Application: Bob's Auto Parts | |
| |
| |
Creating the Order Form | |
| |
| |
Processing the Form | |
| |
| |
Embedding PHP in HTML | |
| |
| |
PHP Tags | |
| |
| |
PHP Statements | |
| |
| |
Whitespace | |
| |
| |
Comments | |
| |
| |
Adding Dynamic Content | |
| |
| |
Calling Functions | |
| |
| |
Using the date() Function | |
| |
| |
Accessing Form Variables | |
| |
| |
Short, Medium, and Long Variables | |
| |
| |
String Concatenation | |
| |
| |
Variables and Literals | |
| |
| |
Understanding Identifiers | |
| |
| |
Examining Variable Types | |
| |
| |
PHP's Data Types | |
| |
| |
Type Strength | |
| |
| |
Type Casting | |
| |
| |
Variable Variables | |
| |
| |
Declaring and Using Constants | |
| |
| |
Understanding Variable Scope | |
| |
| |
Using Operators | |
| |
| |
Arithmetic Operators | |
| |
| |
String Operators | |
| |
| |
Assignment Operators | |
| |
| |
Comparison Operators | |
| |
| |
Logical Operators | |
| |
| |
Bitwise Operators | |
| |
| |
Other Operators | |
| |
| |
Working Out the Form Totals | |
| |
| |
Understanding Precedence and Associativity | |
| |
| |
Using Variable Functions | |
| |
| |
Testing and Setting Variable Types | |
| |
| |
Testing Variable Status | |
| |
| |
Reinterpreting Variables | |
| |
| |
Making Decisions with Conditionals | |
| |
| |
if Statements | |
| |
| |
Code Blocks | |
| |
| |
else Statements | |
| |
| |
elseif Statements | |
| |
| |
switch Statements | |
| |
| |
Comparing the Different Conditionals | |
| |
| |
Repeating Actions Through Iteration | |
| |
| |
while Loops | |
| |
| |
for and foreach Loops | |
| |
| |
do...while Loops | |
| |
| |
Breaking Out of a Control Structure or Script | |
| |
| |
Employing Alternative Control Structure Syntax | |
| |
| |
Using declare | |
| |
| |
Next 572 Storing and Retrieving Data | |
| |
| |
Saving Data for Later | |
| |
| |
Storing and Retrieving Bob's Orders | |
| |
| |
Processing Files | |
| |
| |
Opening a File | |
| |
| |
Choosing File Modes | |
| |
| |
Using fopen() to Open a File | |
| |
| |
Opening Files Through FTP or HTTP | |
| |
| |
Addressing Problems Opening Files | |
| |
| |
Writing to a File | |
| |
| |
Parameters for fwrite() | |
| |
| |
File Formats | |
| |
| |
Closing a File | |
| |
| |
Reading from a File | |
| |
| |
Opening a File for Reading: fopen() | |
| |
| |
Knowing When to Stop: feof() | |
| |
| |
Reading a Line at a Time: fgets(), fgetss(), andfgetcsv() | |
| |
| |
Reading the Whole File: readfile(), fpassthru(), andfile() | |
| |
| |
Reading a Character: fgetc() | |
| |
| |
Reading an Arbitrary Length: fread() | |
| |
| |
Using Other Useful File Functions | |
| |
| |
Checking Whether a File Is There: file_exists() | |
| |
| |
Determining How Big a File Is: filesize() | |
| |
| |
Deleting a File: unlink() | |
| |
| |
Navigating Inside a File: rewind(), fseek(), andftell() | |
| |
| |
Locking Files | |
| |
| |
A Better Way: Database Management Systems | |
| |
| |
Problems with Using Flat Files | |
| |
| |
How RDBMSs Solve These Problems | |
| |
| |
Further Reading | |
| |
| |
Next 803 Using Arrays | |
| |
| |
What Is an Array? | |
| |
| |
Numerically Indexed Arrays | |
| |
| |
Initializing Numerically Indexed Arrays | |
| |
| |
Accessing Array Contents | |
| |
| |
Using Loops to Access the Array | |
| |
| |
Arrays with Different Indices | |
| |
| |
Initializing an Array | |
| |
| |
Accessing the Array Elements | |
| |
| |
Using Loops | |
| |
| |
Array Operators | |
| |
| |
Multidimensional Arrays | |
| |
| |
Sorting Arrays | |
| |
| |
Using sort() | |
| |
| |
Using asort() and ksort() to Sort Arrays | |
| |
| |
Sorting in Reverse | |
| |
| |
Sorting Multidimensional Arrays | |
| |
| |
User-Defined Sorts | |
| |
| |
Reverse User Sorts | |
| |
| |
Reordering Arrays | |
| |
| |
Using shuffle() | |
| |
| |
Using array_reverse() | |
| |
| |
Loading Arrays from Files | |
| |
| |
Performing Other Array Manipulations | |
| |
| |
Navigating Within an Array: each(), current(), reset(), end(), next(), pos(), and prev() | |
| |
| |
Applying Any Function to Each Element in anArray: array_walk() | |
| |
| |
Counting Elements in an | |