5.0 Introduction


What good is data if you can't interpret it? For data to be useful, we need it in a form that we can understand. For example, if we wanted to build a file crawler (see the program at the end of Chapter 7, "Working with Files in Directories"), the actual links we would parse look like this:

 <a href="foo.htm">Foo Description</a> 

However, this form is useless to us. If we wanted to get the link by itself, we would use a regular expression. The actual regular expression might look something like this:

 <a.*href=\"(.+)\".*>.*<\/a> 

But that is getting a little bit ahead of ourselves . First, let us go over some basic regular expressions.



PHP Developer's Cookbook
PHP Developers Cookbook (2nd Edition)
ISBN: 0672323257
EAN: 2147483647
Year: 2000
Pages: 351

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net