Chapter 11. Practical PHP


In this chapter, we'll start working on some of the more common tasks that you'll perform when writing PHP programs, such as work with strings, display formats for strings, as well as dates and time. We'll also show you how to work with files that your PHP program creates or reads. Also, we'll provide an example of how to let a user upload a file and then validate its contents before making it accessible. Uploading files is useful but can be a security risk if files aren't properly validated.

When building HTML output for web pages, we spend quite a bit of time working with strings. PHP has a rich set of functions for doing all the tasks you may need to change the case of a string. You also need to be able to format dates and times. Performing any sort of addition or subtraction on datesthanks to quirks such as leap yearscan quickly become complicated without a little help from functions specifically designed to work with dates.



Learning PHP and MySQL
Learning PHP and MySQL
ISBN: 0596101104
EAN: 2147483647
Year: N/A
Pages: 135

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