Chapter 9. Working with Strings, Dates, and Times


No matter how rich Web content becomes, HTML lies behind it all, pushing string-based content out to Web browsers. It is no accident, then, that PHP provides many functions with which you can format and manipulate strings. Similarly, dates and times are so much a part of everyday life that it becomes easy to work with them without thinking. However, because the quirks of the Gregorian calendar can be difficult to work with, PHP provides powerful tools that make date manipulation an easy task.

In this chapter, you will learn

  • How to format strings

  • How to determine the length of a string

  • How to find a substring within a string

  • How to break a string down into component parts

  • How to remove white space from the beginning or end of a string

  • How to replace substrings

  • How to change the case of a string

  • How to acquire the current date and time

  • How to get information about a date

  • How to format date information

  • How to test dates for validity

  • How to set dates



Sams Teach Yourself PHP MySQL and Apache All in One
Sams Teach Yourself PHP, MySQL and Apache All in One (4th Edition)
ISBN: 067232976X
EAN: 2147483647
Year: 2003
Pages: 333
Authors: Julie Meloni

Similar book on Amazon

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