php_reference_-_beginner_to_intermediate_php5.pdf

(841 KB) Pobierz
PHP Reference: Beginner to Intermediate PHP5
PHP Reference: Beginner to Intermediate PHP5
PHP Reference: Beginner to
Intermediate PHP5
Mario Lurig
1
Mario Lurig
PHP Reference:
2008
Beginner to Intermediate PHP5
ISBN: 978-1-4357-1590-5
Creative Commons Attribution-NonCommercial-ShareAlike 2.0
You are free:
to Share — to copy, distribute and transmit the work
to Remix — to adapt the work
Under the following conditions:
Attribution. You must attribute the work in the manner specified by the
author or licensor (but not in any way that suggests that they endorse you or
your use of the work).
Noncommercial. You may not use this work for commercial purposes.
Share Alike. If you alter, transform, or build upon this work, you may
distribute the resulting work only under the same or similar license to this
one.
For any reuse or distribution, you must make clear to others the license
terms of this work.
Any of the above conditions can be waived if you get permission from the
copyright holder.
Nothing in this license impairs or restricts the author's moral rights.
FIRST EDITION
http://www.phpreferencebook.com
Cover art credit (PHP REFERENCE:), included with permission:
Leo Reynolds ( www.flickr.com/lwr/ ) - 7 images
Patrick Goor ( www.labworks.eu ) - 3 images
Eva the Weaver ( www.flickr.com/evaekeblad/ ) - 2 images
Duncan Cumming ( www.flickr.com/duncan/ ) - 1 image
2
419872116.001.png
 
PHP Reference: Beginner to Intermediate PHP5
Contents
Preface .
.
.
.
.
.
.
5
Miscellaneous Things You Should Know .
.
.
9
Operators
.
.
.
.
.
.
.
19
Control Structures .
.
.
.
.
.
25
Global Variables
.
.
.
.
.
.
33
Variable Functions .
.
.
.
.
.
35
String Functions
.
.
.
.
.
.
41
Array Functions
.
.
.
.
.
.
71
Date/Time Functions .
.
.
.
.
.
103
Mathematical Functions
.
.
.
.
.
111
MySQL Functions
.
.
.
.
.
.
115
Directory & File System Functions .
.
.
.
127
Output Control (Output Buffer)
.
.
.
.
139
Sessions
.
.
.
.
.
.
.
145
Regular Expressions .
.
.
.
.
.
149
Common Language Index .
.
.
.
.
159
Function Index .
.
.
.
.
.
.
161
3
Mario Lurig
4
PHP Reference: Beginner to Intermediate PHP5
Preface
I taught myself PHP and MySQL and found myself, at times,
without internet access and thus without search access to the PHP.net
manual ( http://www.php.net/manual/en/ ). Since coding was not my
primary job, I needed a refresher on syntax, usage, and most of all, a
reminder of how to code PHP without spending an hour debugging a silly
mistake. I printed out reference sheets, cards, cheat sheets and tried to work
off of them exclusively. However, I still found myself needing more than
would fit on one page of 8.5" x 11" paper front and back. So, off I went to the
web and the local bookstore. After spending some time with a few books,
giving them a trial run, I ran into two major problems:
1. I spent most of the time weeding through extensive tutorials to find
the keyword and answer I was looking for, sometimes fruitlessly.
2. Information was biased or surrounded by irrelevant and often
confusing code that did little to explain the what of the function.
I figured I couldn't be the only one with this problem, and quickly
found out that I wasn't alone thanks to a chance run-in at a local bookstore.
Casual PHP programmers, sometimes away from the internet, wanting a
quick reference book that assumes they have some experience with PHP and
understood the basics while still needing a little clarification sometimes on
the details. Therefore, this book was born.
For this edition, I decided to eliminate some of the more advanced
aspects of PHP programming: object oriented programming, image
manipulation/creation, secondary modules, and a few others. Secondarily,
items such as mail handling, file manipulation, regular expressions, MySQL,
sessions, and cookies were balanced for complexity and usability, usually
excluding the more advanced uses, such as streams . Finally, this book is not
an exhaustive collection of every PHP function, but a majority selection of
those appropriate for beginner to intermediate programmers. The most
common or effective functions are included and some aliases are left out to
reduce confusion, such as including is_int() and not is_long().
5
 
Zgłoś jeśli naruszono regulamin