HTML and CSS Reference
In-Depth Information
For example, the eBay website provides an API (application programming interface) that
you can use to integrate your own website with eBay. You could write the code to use
this API yourself, but a library in PEAR already exists. You can find it at
This is just one of the many libraries you can obtain via PEAR. When you're writing
your applications, make sure to check the PHP manual to ensure there's not already a
built-in function to take care of whatever you're doing. If there isn't, check PEAR.
As I said before, I left out huge swaths of PHP functionality in this lesson for the sake of
space. Here are some areas that you'll want to look into before developing your own
PHP applications.
Database Connectivity
I mentioned CRUD applications already. A CRUD application is generally just a front
end for a relational database, which in turn is an application optimized for storing data
within tables. Databases can be used to store content for websites, billing information for
an online store, payroll for a company, or anything else that can be expressed as a table.
It seems like there's a relational database providing the storage for just about every popu-
lar website.
Because databases play such a huge role in developing web applications, PHP provides a
lot of database-related functionality. Most relational databases are applications that can
be accessed over a network, a lot like a web server. PHP is capable of connecting to
every popular relational database. To communicate with relational databases, you have to
use a language called SQL (the Structured Query Language). That's another book unto
Regular Expressions
Regular expressions comprise a small language designed to provide programmers with a
flexible way to match patterns in strings. For example, the regular expression ^a.*z$
matches a string that starts with a , ends with z , and has some number of characters in
between. You can use regular expressions to do much more fine-grained form validation
than I did in Exercise 21.1. They're also used to extract information from files, search
and replace within strings, parse email addresses, or anything else that requires you to
solve a problem with pattern matching. Regular expressions are incredibly flexible, but
the syntax can be a bit complex.
PHP actually supports two different varieties of regular expression syntax: Perl style and
POSIX style. You can read about both of them in the PHP manual.
Search WWH ::

Custom Search