Rockable Press Getting Good with PHP (2012), Informatyka i okolice

[ Pobierz całość w formacie PDF ]
© Rockable Press 2012
All rights reserved. No part of this publication may be
reproduced or redistributed in any form without
the prior written permission of the publishers.
3
Acknowledgement
Acknowledgement
There might be only one name on the cover, but no one writes a
book alone. I am eternally grateful to the following parties:
• God, for orchestrating not just the making of this book,
but my whole life, really.
• Dad and Mom — as well as my siblings and grandpar-
ents — for their support and encouragement throughout
the entire process. They were, and always have been,
willing springboards for ideas and invaluable advisors.
There’s no exaggeration in saying that without them, the
book wouldn’t exist.
• The whole Envato crew and contractors, but especially
Jeffrey, for taking me on as a writer when I’d never done
any tech- or tutorial-writing before and encouraging me
(whether he knows it or not) to continually become a better
writer and developer; Naysan, for suggesting I write this
book, and for organizing the legalities and logistics so
that I could focus on the writing; Peter, for being a meticu-
lous editor, and reigning me in when I tried to do crazy
things with the English language; and the book design
and layout folks, who made all this tough-on-the-brain
teaching so easy on the eyes.
• And inally, you, the reader, without whom the efforts of
the aforementioned parties would be a complete waste.
4
Table of Contents
Contents
Acknowledgement
3
Chapter 1
8
What is PHP?
8
Who is this Book For?
9
How Do You Install PHP?
10
Installing PHP on Windows
11
Installing PHP on Mac OS X
13
PHP on Your Server
15
The Example Files
16
Summary
17
Chapter 2
19
PHP Files
19
Variables
20
Values
21
Strings
22
Numbers
23
Booleans
24
Null
24
Array
24
Comments
26
Operators
27
Arithmetic Operators
27
The String Operator
28
Assignment Operators
29
Incrementing / Decrementing Operators
29
Comparison Operators
30
Logical Operators
32
Conditional Operator
34
Functions
34
Code Style
36
Summary
37
5
Table of Contents
Chapter 3
39
Control Structures
39
if
and
else
(and
elseif
)
39
for
/
foreach
41
return
/
break
/
continue
45
switch
47
require
/
include
/
require_once
/
include_once
49
Final Thought on Control Structures
52
PHP Internal Functions
53
String Functions
53
Breaking Up and Getting Together
54
A Case of Changed Case
55
Keeping Thing Trimmed
56
Replacements
56
How Long?
57
Needle in a Haystack
57
Et Cetera
58
Array Functions
58
Pushin’ and Poppin’
58
Mappin’ and Walkin’
60
Searching High and Low
61
Slicin’ and Dicin’
62
Sorting Things Out
64
Counting Your Chickens (After They Hatch)
64
Summing it all Up
65
Date and Time Functions
65
parse_date
65
time
66
strftime
66
Math Functions
67
max
/
min
67
mt_rand
67
round
/
ceil
/
floor
68
JSON Functions
68
File Functions
69
fopen
69
Reading a File
70
[ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • frania1320.xlx.pl
  • Tematy