SlideShare a Scribd company logo
Download the Full Version of textbook for Fast Typing at textbookfull.com
Programming PHP 4th Edition Peter Macintyre
https://textbookfull.com/product/programming-php-4th-
edition-peter-macintyre/
OR CLICK BUTTON
DOWNLOAD NOW
Download More textbook Instantly Today - Get Yours Now at textbookfull.com
Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.
Learn Java for Android Development: Migrating Java SE
Programming Skills to Mobile Development 4th Edition Peter
Späth
https://textbookfull.com/product/learn-java-for-android-development-
migrating-java-se-programming-skills-to-mobile-development-4th-
edition-peter-spath/
textboxfull.com
Programming Language Concepts Peter Sestoft
https://textbookfull.com/product/programming-language-concepts-peter-
sestoft/
textboxfull.com
Lumen Programming Guide Writing PHP Microservices REST and
Web Service APIs 1st Edition Paul Redmond (Auth.)
https://textbookfull.com/product/lumen-programming-guide-writing-php-
microservices-rest-and-web-service-apis-1st-edition-paul-redmond-auth/
textboxfull.com
Programming WCF Services 4th Edition Juval Löwy
https://textbookfull.com/product/programming-wcf-services-4th-edition-
juval-lowy/
textboxfull.com
Programming in Lua 4th Edition Roberto Ierusalimschy
https://textbookfull.com/product/programming-in-lua-4th-edition-
roberto-ierusalimschy/
textboxfull.com
Pro Functional PHP Programming Application Development
Strategies for Performance Optimization, Concurrency,
Testability, and Code Brevity Aley
https://textbookfull.com/product/pro-functional-php-programming-
application-development-strategies-for-performance-optimization-
concurrency-testability-and-code-brevity-aley/
textboxfull.com
Pro Functional PHP Programming: Application Development
Strategies for Performance Optimization, Concurrency,
Testability, and Code Brevity Rob Aley
https://textbookfull.com/product/pro-functional-php-programming-
application-development-strategies-for-performance-optimization-
concurrency-testability-and-code-brevity-rob-aley/
textboxfull.com
Computer Programming and Utilization, 4e 4th Edition E.
Balagurusamy
https://textbookfull.com/product/computer-programming-and-
utilization-4e-4th-edition-e-balagurusamy/
textboxfull.com
Advanced Apex Programming in Salesforce 4th Edition Dan
Appleman
https://textbookfull.com/product/advanced-apex-programming-in-
salesforce-4th-edition-dan-appleman/
textboxfull.com
Get Programming PHP 4th Edition Peter Macintyre free all chapters
Get Programming PHP 4th Edition Peter Macintyre free all chapters
1. Foreword
2. Preface
a. Audience
b. Assumptions This Book Makes
c. Contents of This Book
d. Conventions Used in This Book
e. O’Reilly Online Learning
f. How to Contact Us
g. Acknowledgments
i. Kevin Tatroe
ii. Peter MacIntyre
3. 1. Introduction to PHP
a. What Does PHP Do?
b. A Brief History of PHP
i. The Evolution of PHP
ii. The Widespread Use of PHP
c. Installing PHP
d. A Walk Through PHP
i. Configuration Page
ii. Forms
iii. Databases
iv. Graphics
e. What’s Next
4. 2. Language Basics
a. Lexical Structure
i. Case Sensitivity
ii. Statements and Semicolons
iii. Whitespace and Line Breaks
iv. Comments
v. Literals
vi. Identifiers
vii. Keywords
b. Data Types
i. Integers
ii. Floating-Point Numbers
iii. Strings
iv. Booleans
v. Arrays
vi. Objects
vii. Resources
viii. Callbacks
ix. NULL
c. Variables
i. Variable Variables
ii. Variable References
iii. Variable Scope
iv. Garbage Collection
d. Expressions and Operators
i. Number of Operands
ii. Operator Precedence
iii. Operator Associativity
iv. Implicit Casting
v. Arithmetic Operators
vi. String Concatenation Operator
vii. Auto-Increment and Auto-Decrement Operators
viii. Comparison Operators
ix. Bitwise Operators
x. Logical Operators
xi. Casting Operators
xii. Assignment Operators
xiii. Miscellaneous Operators
e. Flow-Control Statements
i. if
ii. switch
iii. while
iv. for
v. foreach
vi. try...catch
vii. declare
viii. exit and return
ix. goto
f. Including Code
g. Embedding PHP in Web Pages
i. Standard (XML) Style
ii. SGML Style
iii. Echoing Content Directly
h. What’s Next
5. 3. Functions
a. Calling a Function
b. Defining a Function
c. Variable Scope
i. Global Variables
ii. Static Variables
d. Function Parameters
i. Passing Parameters by Value
ii. Passing Parameters by Reference
iii. Default Parameters
iv. Variable Parameters
v. Missing Parameters
vi. Type Hinting
e. Return Values
f. Variable Functions
g. Anonymous Functions
h. What’s Next
6. 4. Strings
a. Quoting String Constants
i. Variable Interpolation
ii. Single-Quoted Strings
iii. Double-Quoted Strings
iv. Here Documents
b. Printing Strings
i. echo
ii. print()
iii. printf()
iv. print_r() and var_dump()
c. Accessing Individual Characters
d. Cleaning Strings
i. Removing Whitespace
ii. Changing Case
e. Encoding and Escaping
i. HTML
ii. URLs
iii. SQL
iv. C-String Encoding
f. Comparing Strings
i. Exact Comparisons
ii. Approximate Equality
g. Manipulating and Searching Strings
i. Substrings
ii. Miscellaneous String Functions
iii. Decomposing a String
iv. String-Searching Functions
h. Regular Expressions
i. The Basics
ii. Character Classes
iii. Alternatives
iv. Repeating Sequences
v. Subpatterns
vi. Delimiters
vii. Match Behavior
viii. Character Classes
ix. Anchors
x. Quantifiers and Greed
xi. Noncapturing Groups
xii. Backreferences
xiii. Trailing Options
xiv. Inline Options
xv. Lookahead and Lookbehind
xvi. Cut
xvii. Conditional Expressions
xviii. Functions
xix. Differences from Perl Regular Expressions
i. What’s Next
7. 5. Arrays
a. Indexed Versus Associative Arrays
b. Identifying Elements of an Array
c. Storing Data in Arrays
i. Appending Values to an Array
ii. Assigning a Range of Values
iii. Getting the Size of an Array
iv. Padding an Array
d. Multidimensional Arrays
e. Extracting Multiple Values
i. Slicing an Array
ii. Splitting an Array into Chunks
iii. Keys and Values
iv. Checking Whether an Element Exists
v. Removing and Inserting Elements in an Array
f. Converting Between Arrays and Variables
i. Creating Variables from an Array
ii. Creating an Array from Variables
g. Traversing Arrays
i. The foreach Construct
ii. The Iterator Functions
iii. Using a for Loop
iv. Calling a Function for Each Array Element
v. Reducing an Array
vi. Searching for Values
h. Sorting
i. Sorting One Array at a Time
ii. Natural-Order Sorting
iii. Sorting Multiple Arrays at Once
iv. Reversing Arrays
v. Randomizing Order
i. Acting on Entire Arrays
i. Calculating the Sum of an Array
ii. Merging Two Arrays
iii. Calculating the Difference Between Two Arrays
iv. Filtering Elements from an Array
j. Using Arrays to Implement Data Types
i. Sets
ii. Stacks
k. Implementing the Iterator Interface
l. What’s Next
8. 6. Objects
a. Objects
b. Terminology
c. Creating an Object
d. Accessing Properties and Methods
e. Declaring a Class
i. Declaring Methods
ii. Declaring Properties
iii. Declaring Constants
iv. Inheritance
v. Interfaces
vi. Traits
vii. Abstract Methods
viii. Constructors
ix. Destructors
f. Anonymous Classes
g. Introspection
i. Examining Classes
ii. Examining an Object
iii. Sample Introspection Program
h. Serialization
i. What’s Next
9. 7. Dates and Times
a. What’s Next
10. 8. Web Techniques
a. HTTP Basics
b. Variables
c. Server Information
d. Processing Forms
i. Methods
ii. Parameters
iii. Self-Processing Pages
iv. Sticky Forms
v. Multivalued Parameters
vi. Sticky Multivalued Parameters
vii. File Uploads
viii. Form Validation
e. Setting Response Headers
i. Different Content Types
ii. Redirections
iii. Expiration
iv. Authentication
f. Maintaining State
i. Cookies
ii. Sessions
iii. Combining Cookies and Sessions
g. SSL
h. What’s Next
11. 9. Databases
a. Using PHP to Access a Database
b. Relational Databases and SQL
i. PHP Data Objects
c. MySQLi Object Interface
i. Retrieving Data for Display
d. SQLite
e. Direct File-Level Manipulation
f. MongoDB
i. Retrieving Data
ii. Inserting More Complex Data
g. What’s Next
12. 10. Graphics
a. Embedding an Image in a Page
b. Basic Graphics Concepts
c. Creating and Drawing Images
i. The Structure of a Graphics Program
ii. Changing the Output Format
iii. Testing for Supported Image Formats
iv. Reading an Existing File
v. Basic Drawing Functions
d. Images with Text
i. Fonts
ii. TrueType Fonts
e. Dynamically Generated Buttons
i. Caching the Dynamically Generated Buttons
ii. A Faster Cache
f. Scaling Images
g. Color Handling
i. Using the Alpha Channel
ii. Identifying Colors
iii. True Color Indexes
iv. Text Representation of an Image
h. What’s Next
13. 11. PDF
a. PDF Extensions
b. Documents and Pages
i. A Simple Example
ii. Initializing the Document
iii. Outputting Basic Text Cells
c. Text
i. Coordinates
ii. Text Attributes
iii. Page Headers, Footers, and Class Extension
iv. Images and Links
v. Tables and Data
d. What’s Next
14. 12. XML
a. Lightning Guide to XML
b. Generating XML
c. Parsing XML
i. Element Handlers
ii. Character Data Handler
iii. Processing Instructions
iv. Entity Handlers
v. Default Handler
vi. Options
vii. Using the Parser
viii. Errors
ix. Methods as Handlers
x. Sample Parsing Application
d. Parsing XML with the DOM
e. Parsing XML with SimpleXML
f. Transforming XML with XSLT
g. What’s Next
15. 13. JSON
a. Using JSON
b. Serializing PHP Objects
i. Options
c. What’s Next
16. 14. Security
a. Safeguards
i. Filtering Input
ii. Escaping Output Data
b. Security Vulnerabilities
i. Cross-Site Scripting
ii. SQL Injection
iii. Filename Vulnerabilities
iv. Session Fixation
v. File Upload Traps
vi. Unauthorized File Access
vii. PHP Code Issues
viii. Shell Command Weaknesses
ix. Data Encryption Concerns
c. Further Resources
d. Security Recap
e. What’s Next
17. 15. Application Techniques
a. Code Libraries
b. Templating Systems
c. Handling Output
i. Output Buffering
ii. Output Compression
d. Performance Tuning
i. Benchmarking
ii. Profiling
iii. Optimizing Execution Time
iv. Optimizing Memory Requirements
v. Reverse Proxies and Replication
e. What’s Next
18. 16. Web Services
a. REST Clients
i. Responses
ii. Retrieving Resources
iii. Updating Resources
iv. Creating Resources
v. Deleting Resources
b. XML-RPC
i. Servers
ii. Clients
c. What’s Next
19. 17. Debugging PHP
a. The Development Environment
b. The Staging Environment
c. The Production Environment
d. php.ini Settings
e. Error Handling
i. Error Reporting
ii. Exceptions
iii. Error Suppression
iv. Triggering Errors
v. Defining Error Handlers
f. Manual Debugging
g. Error Logs
h. IDE Debugging
i. Additional Debugging Techniques
j. What’s Next
20. 18. PHP on Disparate Platforms
a. Writing Portable Code for Windows and Unix
i. Determining the Platform
ii. Handling Paths Across Platforms
iii. Navigating the Server Environment
iv. Sending Mail
v. End-of-Line Handling
vi. End-of-File Handling
vii. Using External Commands
viii. Accessing Platform-Specific Extensions
b. Interfacing with COM
i. Background
ii. PHP Functions
iii. API Specifications
21. Function Reference
a. PHP Functions by Category
i. Arrays
ii. Classes and Objects
iii. Data Filtering
iv. Date and Time
v. Directories
vi. Errors and Logging
vii. Filesystem
viii. Functions
ix. Mail
x. Math
xi. Miscellaneous Functions
xii. Network
xiii. Output Buffering
xiv. PHP Language Tokenizer
xv. PHP Options/Info
xvi. Program Execution
xvii. Session Handling
xviii. Streams
xix. Strings
xx. URLs
xxi. Variables
xxii. Zlib
b. Alphabetical Listing of PHP Functions
22. Index
Praise for the 4th Edition of Programming PHP
PHP 7 has rejuvenated the PHP ecosystem, providing a powerful mix of world-
class performance and highly anticipated features. If you’re after the book that
would help you unlock this potential, look no further than the new edition of
Programming PHP!
—Zeev Suraski, Cocreator of PHP
By selecting Programming PHP you have taken that first step not only into PHP
and its basics but into the future of website and web application development.
With a firm understanding of the PHP programming language, and the tools
available to you, the only limitations will be your imagination and your
willingness to continue to grow and immerse yourself in the community.
—Michael Stowe, Author, Speaker, and Technologist
Covers all the details you’d expect in a programming language book and gets into
more advanced topics that seasoned veterans would find interesting.
—James Thoms, Senior Developer at ClearDev
Programming PHP
FOURTH EDITION
Creating Dynamic Web Pages
Kevin Tatroe and Peter MacIntyre
Programming PHP
by Kevin Tatroe and Peter MacIntyre
Copyright © 2020 Kevin Tatroe and Peter MacIntyre. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA
95472.
O’Reilly books may be purchased for educational, business, or sales promotional use.
Online editions are also available for most titles (http://oreilly.com). For more
information, contact our corporate/institutional sales department: 800-998-9938 or
corporate@oreilly.com.
Acquisitions Editor: Jennifer Pollock
Development Editor: Angela Rufino
Production Editor: Christopher Faucher
Copyeditor: Rachel Monaghan
Proofreader: Tom Sullivan
Indexer: Potomac Indexing, LLC
Interior Designer: David Futato
Cover Designer: Karen Montgomery
Illustrator: Rebecca Demarest
March 2002: First Edition
April 2006: Second Edition
February 2013: Third Edition
March 2020: Fourth Edition
Revision History for the Fourth Edition
2020-03-12: First Release
See http://oreilly.com/catalog/errata.csp?isbn=9781492054139 for release details.
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Programming
PHP, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc.
The views expressed in this work are those of the authors, and do not represent the
publisher’s views. While the publisher and the authors have used good faith efforts to
ensure that the information and instructions contained in this work are accurate, the
publisher and the authors disclaim all responsibility for errors or omissions, including
without limitation responsibility for damages resulting from the use of or reliance on
this work. Use of the information and instructions contained in this work is at your own
risk. If any code samples or other technology this work contains or describes is subject
to open source licenses or the intellectual property rights of others, it is your
responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-492-05413-9
[LSI]
Dedication
To Jenn
—KT
I would like to dedicate my portions of this book to my still wonderful wife,
Dawn Etta Riley. I love you!
—PBM
Foreword
It’s hard to believe that nearly 20 years ago I picked up my first PHP book. I had an
interest in programming, extending beyond Netscape Composer and static HTML. I
knew PHP would enable me to create dynamic, smarter websites—and to store and
fetch data to create interactive web applications.
What I didn’t know was the journey that unlocking these new capabilities with PHP
would take me on, or how PHP would evolve 20 years later to become the
programming language powering roughly 80% of the web, and backed by one of the
nicest, friendliest, and most engaging communities.
A journey of a thousand miles begins with a single step. By selecting Programming
PHP by Peter MacIntyre and Kevin Tatroe, you have taken that first step not only into
PHP and its basics, but also into the future of website and web application
development. With the available tools and a firm understanding of the PHP
programming language, the only limitation will be your imagination and your
willingness to continue to grow and immerse yourself in the community. The journey is
yours, the possibilities endless, and the future for you to define.
As you get ready to begin this journey, I would like to share a couple tidbits of advice.
First, take each chapter and put it into practice, try different things, and don’t be afraid
of breaking something or failing. While Programming PHP will establish a strong
foundation, it’s up to you to explore the language and find new and creative ways to
pull together all of these components.
My second piece of advice: be an active part of the PHP community. Take advantage of
online communities, user groups, and PHP conferences as you are able. As you try new
things, share them with the community for their feedback and advice.
Not only are you sure to find a community of support—a group of some of the nicest
people, who want you to succeed and are more than happy to take their time to help you
through your journey—but you’ll also establish a baseline of continuous learning,
helping you grasp the core skills of PHP more quickly and keeping you up to date on
new programming theories, technologies, tools, and changes. Not to mention, you’ll
encounter an onslaught of terrible puns (including from yours truly).
With that, I would like to be among the first to welcome you and to wish you the very
best on your journey—a journey that couldn’t start off better than with this book!
Michael Stowe, author, speaker, and technologist
San Francisco, California, Winter 2020
Preface
Now more than ever, the web is a major vehicle for corporate and personal
communications. Websites carry satellite images of Earth in its entirety; search for life
in outer space; house personal photo albums, business shopping carts, and product lists;
and so much more! Many of those websites are driven by PHP, an open source scripting
language primarily designed for generating HTMLcontent.
Since its inception in 1994, PHP has swept the web and continues its phenomenal
growth today. The millions of websites powered by PHP are testament to its popularity
and ease of use. Everyday people can learn PHP and build powerful dynamic websites
with it.
The core PHP language (version 7+) features powerful string- and array-handling
facilities, as well as greatly improved support for object-oriented programming. With
the use of standard and optional extension modules, a PHP application can interact with
a database such as MySQLor Oracle, draw graphs, create PDF files, and parse XML
files. You can run PHP on Windows, which lets you control other Windows
applications (such as Word and Excel with COM) or interact with databases using
ODBC.
This book is a guide to the PHP language. When you finish it (we won’t tell you how it
ends!), you will know how the PHP language works, how to use the many powerful
extensions that come standard with PHP, and how to design and build your own PHP
web applications.
Audience
PHP is a melting pot of cultures. Web designers appreciate its accessibility and
convenience, while programmers appreciate its flexibility, power, diversity, and speed.
Both cultures need a clear and accurate reference to the language. If you are a (web)
programmer, then this book is for you. We show the big picture of the PHP language,
and then discuss the details without wasting your time. The many examples clarify the
textual explanations; the practical programming advice and many style tips will help
you become not just a PHP programmer, but a good PHP programmer.
If you’re a web designer, you will appreciate the clear and useful guides to specific
technologies, such as JSON, XML, sessions, PDF generation, and graphics. And you’ll
be able to quickly get the information you need from the language chapters, which
explain basic programming concepts in simple terms.
This edition has been fully revised to cover the latest features of PHP version 7.4.
Assumptions This Book Makes
This book assumes you have a working knowledge of HTML. If you don’t know
HTML, you should gain some experience with simple web pages before you try to
tackle PHP. For more information on HTML, we recommend HTML & XHTML: The
Definitive Guide by Chuck Musciano and Bill Kennedy (O’Reilly).
Contents of This Book
We’ve arranged the material in this book so that you can either read it from start to
finish or jump around to hit just the topics that interest you. The book is divided into 18
chapters and 1 appendix, as follows:
Chapter 1, Introduction to PHP
Talks about the history of PHP and gives a lightning-fast overview of what is
possible with PHP programs.
Chapter 2, Language Basics
Is a concise guide to PHP program elements such as identifiers, data types,
operators, and flow-control statements.
Chapter 3, Functions
Discusses user-defined functions, including scope, variable-length parameter lists,
and variable and anonymous functions.
Chapter 4, Strings
Covers the functions you’ll use when building, dissecting, searching, and modifying
strings in your PHP code.
Chapter 5, Arrays
Details the notation and functions for constructing, processing, and sorting arrays in
your PHP code.
Chapter 6, Objects
Covers PHP’s updated object-oriented features. In this chapter, you’ll learn about
classes, objects, inheritance, and introspection.
Chapter 7, Dates and Times
Discusses date and time manipulations like time zones and date math.
Chapter 8, Web Techniques
Talks about techniques most PHP programmers eventually want to use, including
processing web form data, maintaining state, and dealing with SSL.
Chapter 9, Databases
Discusses PHP’s modules and functions for working with databases, using MySQL
database as examples. Also, SQLite and PDO database interface are covered.
NoSQLconcepts are also covered here.
Chapter 10, Graphics
Demonstrates how to create and modify image files in a variety of formats from
within PHP.
Chapter 11, PDF
Explains how to create dynamic PDF files from a PHP application.
Chapter 12, XML
Introduces PHP’s extensions for generating and parsing XMLdata.
Chapter 13, JSON
Covers JavaScript Object Notation (JSON), a standardized data-interchange format
designed to be extremely lightweight and human-readable.
Chapter 14, Security
Provides valuable advice and guidance for programmers creating secure scripts.
You’ll learn programming best practices to help you avoid mistakes that can lead to
disaster.
Chapter 15, Application Techniques
Talks about coding techniques like implementing code libraries, dealing with output
in unique ways, and error handling.
Chapter 16, Web Services
Describes techniques for dealing with external communication via REST tools and
cloud connections.
Chapter 17, Debugging PHP
Discusses techniques for debugging PHP code and for writing debuggable PHP
code.
Chapter 18, PHP on Disparate Platforms
Discusses the tricks and traps of the Windows port of PHP. It also discusses some
of the features unique to Windows, such as COM.
Appendix
Serves as a handy quick reference to all core functions in PHP.
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic
Indicates new terms, URLs, email addresses, filenames, and file extensions.
Constant width
Used for program listings, as well as within paragraphs to refer to program
elements such as variable or function names, databases, data types, environment
variables, statements, and keywords.
Constant width bold
Shows commands or other text that should be typed literally by the user.
Constant width italic
Shows text that should be replaced with user-supplied values or by values
determined by context.
NOTE
This icon signifies a tip, suggestion, general note, warning, or caution.
O’Reilly Online Learning
Discovering Diverse Content Through
Random Scribd Documents
Russian or Polish Jews. Very many of the cases brought by the
Jewish women are extremely difficult to handle owing to the fact that
the desertion has oftentimes taken place in Europe. A man living in
the ghetto of Warsaw or Bialystok or Wilna will decide to come to
America to seek his fortune. Not having money enough to bring his
wife and family, he starts out alone leaving behind him the
assurances that he will return for them, or will send them money to
bring them over. As a rule two or three letters at least are sent back
to the old country, containing money orders for little sums of money,
then the letters will cease. Sometimes the wife waits for four or five
or six years before in despair she sets out in quest of her husband.
Sometimes she finds him married to some American woman or some
woman he has met over here, and then she goes to court with her
trouble. The law here is confronted with the situation obviously
impossible to handle with equal justice to all parties concerned
without working hardship somewhere. The wife from the Old World
with her children certainly has first claim upon the man, but at the
same time the wife whom he has married here has perhaps married
him in good faith, knowing nothing about the other family, and so
have her children been born.
The Italians are the second largest nationality in the classification
of the domestic relations court cases. The Italians are very apt to be
disorderly persons. They are hot tempered, quick to strike and a
great many times an Italian wife appeals to the domestic relations
court because her husband has been cruel to her and struck her,
and this court is obliged to send her to the magistrates court in order
that her husband may be treated as a disorderly person. In justice to
the Italians of Northern Italy, it should be stated that it is very rare to
find an Italian in the domestic relations court who originally came
from any province in Italy north of Rome. The great mass of Italians
who get into this court are Neapolitans, Calabrians and Sicilians. The
third group are from Central Europe, Hungarians, peoples from the
Balkan states, Galicia and other provinces of Austria. The French
rarely are obliged to appeal to the domestic relations court. The
French are naturally a home-loving people, and anything like a
domestic break is rare among them. Only two or three times since
this court was established have French couples been obliged to
appear there. A great many people classify themselves as
Americans when as a matter of fact they are foreign born, so that the
figures in regard to the number of Americans in this court are
misleading. Negroes, however, turn up here in great numbers.
Colored men often have no sense of responsibility whatever and
they are constantly forsaking their wives and families or going off
with somebody else’s wife. The excuses offered by colored men who
are haled into this court are often very amusing.
For the most part, however, this is not an amusing court. The long
line of people who press before Judge Cornell and Judge Harris day
after day, is for the most part a sordid, hideous line, and the tales the
complainants tell fill one with contempt and sourness toward
humanity. The domestic relations court offers an even seamier
picture of life in this city than the magistrates courts. While it is true
that occasionally a family of the better class makes appeal to this
court, for the most part the clients are illiterate and very poor. A very
large per cent. of the cases that are brought here are people who, if
abandoned, would become public charges. That is why the state
interests itself to the extent of providing a counsel for complainants,
in order to protect itself from the burden of caring for helpless women
and little children, whom some individual has simply deserted. There
are people who pretend to find amusement in the rehearsal of the
marital woes of the poor. To be sure, occasionally a case turns up
with its funny side, but to me the recitals are heartbreaking and
dreary.
In the state of New York the failure of a man to support his wife, if
there are no children, the crime ranks as a misdemeanor, and six
months in the workhouse is the maximum penalty which can be
imposed upon him. The domestic relations court, in specializing on
this phase of law, will undoubtedly lead to certain reforms and
amendments to the existing law tending ultimately to develop a
system of domestic relations jurisprudence. It is a great boon, as it
stands today, to suffering poor women. Any woman without a dollar
in the world can walk into the domestic relations court, tell her
troubles to the clerk of the court, and then if her case is a worthy
one, she is within a few minutes placed on the witness stand, where
she can repeat the recital to the judge. The whole proceeding of
bringing her husband to the bar of justice and getting the court to
forcing him to provide for her is speedy and absolutely without cost.
A woman under our present system of life ought to have a court of
this kind in which she may take refuge, because the world at large is,
at the present time, so unfair to women. A woman can serve a man
for years, bear him a large family of children, and suddenly be
deserted and left with the burden of support for herself and family on
her. If her husband is faithless, all she can do is to appear before the
supreme court and apply for a divorce, but in this domestic relations
court the judge will make her husband contribute to her support and
to the support of his children.
Drink is frequently at the bottom of domestic troubles, but not
nearly so often as most people would think. Drink, especially
whiskey, frequently makes a man irritable and quarrelsome, which
leads to family rows and frequently to disorderly conduct. The
greatest number of cases that come into this court are against
shiftless, worthless, idle men who seem to belong naturally to the
submerged tenth. One day this week I sat with Judge Cornell for an
entire session of the court and the run of cases which appeared that
day gave ample indication of the tone of the court. One case was of
a colored girl who has been married less than a year, who had
brought her big black husband into the court to explain why he had
abandoned her. The explanation was frankly given. He was so
accustomed to living with white women, he said that he could not
bring himself to live any longer with the wife of his own color. He was
bonded to pay his wife $1 a week. Another woman, neat, pretty and
intelligent, a California girl, not yet twenty, had had her husband
arrested because he insisted that she go on the streets and make
money, not only for herself but for him, as a public prostitute. An Irish
woman complained that her husband who made good wages drank it
all up. He countered by stating, under oath, that his wife was an
habitual drunkard, which made no impression whatsoever on the
court, because the woman was particularly prepossessing and
without a single incriminating mark upon her. There were the usual
number of Jewish women whose husbands had simply gone off
saying they would have nothing more to do with them. And one or
two Italian women, with small babies in their arms, whose husbands
had got angry with them and put them out of the house or struck
them.
It is a miserable, pitiable phase of life that one sees in the
domestic relations court, but that the court is so overworked, so
constantly busy, is justification enough for its establishment and
indication that any large community requires some such institution to
placate and bring together men and women, husbands and wives,
whom oftentimes trifling difficulties are about to separate, and to
make it impossible for husbands to desert their wives with impunity.
That there should be only three such courts in this country is a
striking commentary on the life we lead when it has been proved and
demonstrated so extraordinarily by the domestic relations court in
New York city that the need is so great. A visit to the domestic
relations court will not insure a pleasant afternoon or an amusing
hour, but it will prove an enlightening experience.
IN THE PRISONERS’ AID FIELD
PRISONERS’ AID
WORK IN CALIFORNIA
The San Francisco Post reports that:
“A statement of the work of the California prison commission
during the past year shows that a remarkable number of men and
women, who have been released from prison, have been given
employment by this organization through the good work that is being
accomplished at Golden Rule Hall. At this place those who have
been discharged from prison are provided for until suitable
employment is found for them.
“During the past year 465 have been placed in positions, an
average of nine a week. Of these 26 were over 60 years of age, and
four over 80. Fourteen consumptives were placed either in positions
of light employment or in homes or hospitals. More than 200 were
sent direct from prison to employment; others, who were either
invalids, cripples, or aged, were temporarily boarded at Golden Rule
Hall. Another good office of the commission is to look after the wives
and children of prisoners.
“All of this work has entailed a great deal of expense. The building
and equipment of Golden Rule Hall, to take the place of the building
that was destroyed by fire, has put the organization into debt. An
appeal is being made to the public to lessen this difficulty, and to
help along an institution that is doing much toward preventing a
repetition of crimes by ex-convicts.”
As to the renovation of San Quentin prison, the Post says:
“Within a few months the new 800-room concrete and steel
cellhouse now in course of construction at San Quentin prison will be
completed.
“The building is a prison within a prison, and is a class A
structure, 600 feet in length and 60 feet in height. The cells are built
in the center of the structure and run its full length. There are four
tiers with 200 cells on a tier. Four hundred of these cells are
separated by steel bars and are so arranged that twenty-five may be
bolted at the same time. Eight hundred prisoners may be locked up
three minutes after they reach the inside of the prison.
“The walls and the cells of the new prison are built of reinforced
concrete and in every foot of concrete steel bars are laid, running
parallel and perpendicular, making it impossible for a prisoner to cut
through at any point of his cell.
“All the steel and iron work was turned out by the prisoners. Every
part of the new building was manufactured and erected by prison
labor. The roof of the structure is of copper and slate and has been
pronounced by experts to be of the finest workmanship. The inside is
finished with plaster and so clever is the workmanship that it
resembles enamel work.
“Work is now being done on a wall sixty feet high and six feet
thick by the prisoners. This will surround the cellhouse. Upon
completion an electric light plant and heating apparatus will be
installed.
“Warden Hoyle plans when the new cellhouse is ready for
occupancy to put his new grading system into execution. The new
prison will house all the first termers and they will not mingle with
second and third term convicts. Each grade will have a separate
yard and under the first grade the prisoners will wear a uniform.
“The second termers will be together and wear a different kind of
a uniform. The third grade will consist of life termers and hardened
criminals. These will wear stripes.
“The first-grade prison will be known as the reformatory, and at
any time a prisoner’s deportment is bad he will be sent into the
second-grade prison.”
SUPPORTING A
GOOD WARDEN
The Prisoners’ Aid Society of Baltimore has recently taken up the
cudgels for the retention in office of Charles A. Hook, warden of the
Baltimore city jail. A letter to the mayor of Baltimore details some of
the improvements effected by Warden Hook.
“The citizens of Baltimore have every reason to be proud of this
their one definite penal institution. It has reached an excellence of
administration and a physical condition that place it easily among the
foremost institutions of similar nature throughout the country. The
improvements have been very marked, and from simply a
correctional and detentional institution it has been transformed into a
place of real helpfulness and reformation.
“This state of efficiency is the direct result of the wise, practical
and broad-spirited administration of its warden, Mr. Charles A. Hook.
Warden Hook is a student of criminology. He has taken advantage of
every opportunity to meet the wardens of other institutions and
gathered from these conferences that which would be helpful to his
own administration.
“It is becoming more and more evident that the administration of a
penal institution should be as scientifically based as the
administration of a medical infirmary, and no greater boon can be
conferred for the welfare of the municipality than the removal of this
office from political influence.
“To state concretely some of the very many improvements of this
institution I would name the following:
“The addition of 328 new concrete cells for men and women, with
all modern improvements for hygiene and sanitation.
“New hospital and operating room in the main building.
“A library for the prisoners.
“New hot water system for bathing purposes.
“New beds made especially in the institution for the purpose of
extreme cleanliness.
“New sterilizing plant for infected clothing.
“New baths and clothes rooms for prisoners.
“New four-story workshop, of brick and cement.
“New jail workshop, where articles used by the prisoners are
made.
“The substitution of machinery for the hands of the prisoners in
the bakeshop.
“In the moral features of the institution:
“No official is now allowed to strike a prisoner except in self-
defense.
“All cases of infringement of rules are settled by the warden
himself.
“Dark cells and shower baths for punishment abolished.
“All prisoners have the ear of the warden and he gives every
Sunday morning to visitation and the consideration of personal
requests and grievances.
“Prisoners working in the shops with sentences of three months or
over are allowed one-fourth of their earnings, one-half payable
during confinement and the remainder on release.
“Through the personal interest of the warden and his assistants a
large share of the amount earned by the prisoners during
confinement is paid to their families.
“The definite result of these marked improvements in the physical
condition and the moral and spiritual administration is very apparent
in the number of inmates who are brought to realize the possibilities
of a better life through reformation, and by this specific work the
population of the jail is smaller than it has been in past years.
“Every co-operation and sympathy have been granted the work of
the Prisoners’ Aid Association by Warden Hook and his assistants,
and through this co-operation a splendidly large number of men and
women are being returned to society law-abiding and self-
respecting.”
EVENTS IN BRIEF
[Under this heading will appear each month numerous paragraphs of
general interest, relating to the prison field and the treatment of the
delinquent.]
Congress of Juvenile Court Judges.—Eight hundred invitations
are being sent out by Judge Muir Weissinger and his advisory board
of the Juvenile Court, for the third annual conference of juvenile
court judges of the central states to be held in Louisville November
14, 15 and 16. The invitations go to judges in Kentucky, Tennessee,
Indiana, Ohio, Illinois, Michigan, Missouri, Kansas, Oklahoma and
Colorado. Special invitations are issued to officials of institutions in
Kentucky interested in juvenile corrections and the juvenile judges in
other states are asked to bring with them such probation officers and
other officials as may wish to attend the conference.
Reformatory versus Prison.—That the proper classification of
prisoners is of basic importance in any effort to reform and
rehabilitate them, and that courts are often parties to the creation of
almost insuperable difficulties in this regard is shown in a recent
article in the Rahway (New Jersey) Herald:
D. George Wight, commissioner of charities and correction of
New Jersey finds that there is no uniform rule under which the
common pleas judges of the state deal out sentences. There are a
number of first offenders in the state prison who should have been
sent to the reformatory, and there are numerous cases where
prisoners should have been sent to the state prison instead of the
reformatory. Dr. Wight also shows that there are a number of
hardened criminals confined in the reformatory.
The out-of-place presence of these detained persons interferes
with the work in the prison and in the reformatory. Mr. Osborne,
warden of the state prison, concludes that reformation is an almost
impossible achievement in the state prison, and Dr. Moore,
superintendent of the state reformatory, is of the opinion that the
presence of hardened criminals in the reformatory prevents the
carrying on of efficient reformatory work in his institution.
Under the existing laws it is provided that the male first offenders
between the ages of 16 and 30 years shall be sent to the
reformatory. Notwithstanding the provisions, Dr. Wight’s statistics
show that from June, 1909, to June, 1911, there were committed to
the state prison 240 prisoners of the first offender class, and less
than 25 years of age. Dr. Wight shows that this total is twenty-five
per cent. of the commitments during the two years which the
statistics cover. There have been 231 commitments to the Rahway
reformatory in the past year, and of this number at least fifty-five per
cent. are second offenders, and some of the men are serving their
third and fourth terms in prison. The report of Dr. Moore shows that
of the commitments in the past year sixty-nine are second offenders,
thirty-three are third offenders, eighteen are fourth offenders, five are
fifth offenders and six are sixth offenders, leaving 104 first offenders
committed during the year, with a total of 234.
The investigation shows that the sentences imposed by the trial
judges have not been based upon the seriousness of the crime, but
upon the individual preferences of the court.
A Prison Program for New York.—Commissioner Frank E. Wade,
of Buffalo, has embodied the results of a recent careful inspection of
the county penitentiaries of New York (New York, Albany, Onondaga,
Monroe and Erie) in well digested reports to the commission, and in
addition recommends a policy of action for the state which deserves
quoting. For years the inefficient county management of most of the
penitentiaries has been notorious.
“Control of the penitentiaries under existing conditions is
essentially a state function. The prospects, however, of state
ownership are not promising for some time to come. The initial cost
will be so great that, in the present condition of state finances, the
proposition for the purchase of these institutions is not likely to meet
with favor; furthermore, there are some related problems which
should be settled before state ownership of penitentiaries. I refer to a
state farm for vagrants, a reformatory for male misdemeanants
between the ages of 16 and 21 and the development of industries in
the penitentiaries.
“The state is already committed to the farm colony plan and its
successful operation will decrease the number in the penitentiaries
of the most hopeless class of inmates as far as penitentiary
treatment is concerned.
“A state reformatory for misdemeanants, where boys between the
ages of 16 and 21 can be committed on an indeterminate sentence
and receive instruction in trades and letters, is the most necessary
and urgent prison reform under public discussion. These boys can
now be committed only to penitentiaries and jails, except in the city
of New York, and the penitentiary and jail associations and treatment
confirm them in criminal habits.
“The introduction and extension of industries in the penitentiaries
is of vital importance. The present idleness of the prisoners in all the
penitentiaries (except New York and Onondaga county
penitentiaries, where the product can be increased fifty per cent) is
tending to destroy their future usefulness and turn them into loafers.
It is the duty of the state commission of prisons to present the evils
of this idleness to the public and to endeavor to have the county
authorities furnish employment for all the prisoners, as required by
law.
“The enactment of a law permitting the superintendent of prisons
to market the product of the penitentiaries will be of great assistance.
Staple industries could then be established and industries
supplementary to those in the state prisons could be installed in the
penitentiaries.
“The proposition of paying prisoners or their families a portion of
the earnings is involved in the development of the industries in the
penitentiaries. At present the idleness and the heavy cost of
maintenance will not permit such payments, but if the earnings of
prisoners were materially increased a substantial percentage might
be given.”
Mr. Hall on Prison Reform.—Albert H. Hall, who has the gift of
“speakin’ out in meetin’” to some purpose, outlined at the recent
annual conference of the American Institute of Criminal Law and
Criminology what Minnesota has recently done, and recommended a
law which has been enacted this year in his own state. He stated the
provisions of that law, giving the reasons for each. All sentences,
except for treason or murder in any of the degrees, shall be
indeterminate: they shall be without limit of time. A board of parole is
established, with the prison warden as a member ex-officio, to
observe the prisoners, study them minutely, inquire into their history
and watch their tendencies and their motives, and learn all about
them. With this knowledge about them, the board establishes a
record of marks, giving credit for merits and charge for derelictions,
and on the basis of such register the board may release the prisoner
on parole when it deems it expedient. The prisoners are to be
provided with the rules and regulations, enabling them to score
themselves, if they like, and giving them the right of a hearing before
the board if they think the official score does not give them full credit.
In order that all shall be treated absolutely alike, petitions from
outside persons for the release of any prisoner will not be received
or acted upon. The initiative is to rest with the board, and it may
modify its conditions of parole during the period the prisoner remains
under its observation. The prison warden is made a member of the
board because of his intimate knowledge of the prisoners.
Another feature of the proposition is that the prisoner loses his
citizenship when he is sentenced, and its restoration rests with the
governor, to whom the board of parole is to certify when it grants an
absolute release, stating the reasons for the release.
Addressing himself to the merits of the general proposition, Mr.
Hall declared that the deterrent of crime is not the punishment, but
the fear of conviction. What any person respects more than anything
else is his honor, and he shrinks from being branded as a criminal.
The system proposed puts him on his own honor and gives him hope
and ambition.
Changes at Atlanta.—Widespread newspaper attention has been
given to proposed changes at the Federal prison at Atlanta.
Hereafter the emphasis will be placed upon reformation instead of on
punishment. The convicts will no longer be regarded as dangerous
and unmanageable animals, to be subjected only to hard labor,
coarse diet and various degrees of punishment, but they will be
treated as men: men facing a future filled with the opportunity of
reformation, and the influences of prison life will be directed towards
the development of their manhood and the creation of new hope in
their bosoms.
In the prosecution of this new plan a prison library will be
inaugurated, a school established, concerts given by a band to be
formed among the inmates and games permitted in the leisure
hours. Good behaviour will be rewarded by increased opportunities
for instruction and amusement; bad conduct will be punished by
curtailment of privilege.
A Governor to Stump for Prison Reform.—The Boston Advertiser
reports that Gov. Foss having pardoned 51 convicts, and broken the
record, will make prison reform an issue on the stump. He says:
“I have pronounced ideas on the subject. I have received many
letters commenting favorably on the reforms that I suggested in my
address before the American Bar Association. Massachusetts is
standing still on the treatment of its prisoners.
“There are hundreds of so-called criminals in the prisons who may
be cured just as people in hospitals are cured of disease.
“Only a very small number of the men in prison are habitual
criminals. I don’t wish my ideas to be misinterpreted. Some of my
political opponents are attempting to picture me as opening the
doors of the prisons. As a matter of fact, I have very decided ideas
on the protection of the public from the habitual criminal.
“There are many men in the prisons, however, who commit crime
when under the influence of liquor. They become brutes when under
the influence of liquor, but when sober and temperate are perfectly
normal, first-class citizens who may become a credit to their various
communities.”
Transferring Prisoners.—A recent Auburn (N. Y.) newspaper item
states that forty-four prisoners were that day transferred to Comstock
prison, a journey of about 200 miles. “At 9.30 the prisoners were
manacled by twos, with handcuffs on their wrists, and short lengths
of chain between their feet, making the act of walking as difficult as a
three-legged race. They were marched by twos to the outside prison
gate, and lined up while the guards placed themselves in position. At
the word, the gate swung back, and the line of gray suits filed out,
with a guard in blue at the side of every ten or twelve men. Marching
to the New York Central station across the street, each man carrying
a small bundle containing a few private belongings, they waited for
the train which was half an hour late. A crowd of morbidly curious
quickly rushed to the spot.
“When the train finally pulled in, the prisoners were marched up
the steps of a special car and down the aisles in regular order. Some
difficulty was experienced in getting the men, impeded as they were,
up the car steps, and they all smiled at the bystanders as if they
were enjoying the little trip in the open air. The guards took up their
positions inside the car, the doors were locked, and the train pulled
out, leaving the crowd to comment upon the late spectacle.”
Germany’s methods could teach us much by comparison.
Transfer of prisoners is specially frequent because in Prussia
practically all persons are under a central authority, the department
of justice, which transfers prisoners according as fluctuations of
population in the prisons occur. By arrangement with the railroads—
which in Prussia are under governmental control and operation—
specially constructed railway prison cars are attached to early
morning or late evening trains, the cars being so constructed as not
to afford public display of the prisoners. From the interior of the
prison the prisoners are conveyed in vans to the railway stations. So
important and frequent are these transfers that a small corps of
prison department officials are assigned solely to this special work.
This is a “made in Germany” humane plan that deserves our
contemplation.
A Michigan Prison Farm.—The Detroit (Mich.) News prints the
following editorial, entitled “Prison Farm Redemption”:
The state at large has not heard more encouraging news of
progress in any of its institutions than Warden Simpson sets forth in
his report on the management and operation of the prison farm at
Jackson. The farm is not a big one—only 30 acres in extent—and it
admits of little more than experimenting. But the warden and his
charges have done some important work on it in the summer now
ending. They have grown cabbages, peas, beets, parsnips, carrots,
onions, radishes, lettuce, cucumbers, sweet corn and tomatoes
enough of the staples to supply the prison for a whole year, and
enough of the seasonal produce to give the prisoners fresh
vegetables during the summer. One of the new silos will be filled with
the ensilage from the green corn. The shelves in the fruit cellars hold
5,000 quarts of canned strawberries, while the memory of seven
“feeds” of fresh berries and cream, not to mention shortcake, still
lingers with the prisoners. Fifty bushels of huckleberries have been
picked from the prison farm marsh. When the tomatoes and apples
are ripe, 5,000 gallons of them will be put up for the winter table. In
four months 133 hogs have been fattened and slaughtered, yielding
22,077 pounds of fresh pork. All this has been done at a monetary
profit to the state. For the bigger profit reference is made to the
warden’s own words:
“The inmate working upon the farm, in addition to his
useful service, is forming for himself habits of industry,
growing fond of his work, perhaps to the extent of following
this vocation at the time of his parole and release, thus taking
him away from questionable haunts and evil associates
known to him of former years in his city home. In my opinion
there is no work, trade or calling to which men striving for a
livelihood may fall heir, so conducive to the development of
health, happiness, honesty and independence, combined with
all the attributes of a good citizen, as practical and successful
farming.”
The Montpelier (Vt.) Jail.—The Review mentioned briefly the
remarkable success of Sheriff Tracy of Montpelier, Vermont, in
allowing his prisoners to go out to work for farmers and other
employers. In the Atlantic Monthly for August Morrison I. Swift tells
interestingly of the results lately:
“The state of Vermont contains a prison where the inmates are
treated upon a novel plan. They are trusted and treated like other
human beings; they come and go almost as freely as the members
of the jailer’s own family; so far as possible, whatever suggests
punishment or disgrace is banished, and they are made to feel that
their imprisonment is designed to improve them as men and to
restore them to social life not only with full self-respect but with the
cordial respect of the community.
“This great innovation in prison practice was made possible by a
state law authorizing all sheriffs to set their prisoners at work either
inside or outside the jails. In Montpelier, where this prison stands, the
inveterate prejudice against prisoners has been swept away.
“As late as two or three years ago, when the men did not return
promptly to the jail at the time appointed the sheriff would become
nervous and go out to walk the streets looking for them. That is all
past now, not only because of the unsuspected traits of human
nature that experience has unfolded but because of the marvellous
practical success of the system. During the four years, out of 800
prisoners treated upon the new plan only two attempted to escape,
both of whom were recaptured and sentenced to long terms in the
house of correction for betraying the trust reposed in them. With
such a record as this the sheriff no longer feels perturbed if his entire
corps of prisoners is scattered in every direction during the day, and
he is perfectly assured that at night they will reappear at the jail.
“During the whole period their labor earned above $6,000, of
which a total exceeding $2,600 was kept by themselves. As a rule
the men have carefully saved their money, limiting permitted
purchases for themselves to send it home to those dependent on
them.”
Intemperance and Imprisonment Causes of Poverty.—Just at the
time when a board of inebriety has been appointed in New York, the
New York Association for Improving the Condition of the Poor, one of
the largest and oldest relief societies of this country, announces the
results of a statistical study, commented upon thus in the New York
World:
“Only two families in every hundred of the 1,573 which have been
in the care of the Association for Improving the Condition of the Poor
this summer were brought to poverty through intemperance. The
percentage goes against preconceived notions and is indeed
surprisingly small. It should disturb that prosperous complacency
which sees in poverty only or mainly the penalty of wanton misdeed.
The association’s report for 1909 showed that intemperance,
imprisonment, desertion, ‘shiftlessness and inefficiency,’ all told,
accounted for not 12 per cent of those brought to want.
“The figures for that year showed that 65 per cent of the poverty
was due to two causes—sickness and unemployment. This summer
the two causes account for 68 per cent of the poverty noted, and 43
per cent, or nearly half, was due to sickness alone. Here are causes
of misery which society can abate or largely remove and the
economic evils of which it can provide against through some form of
insurance.”
Prison Labor in District of Columbia.—The establishment of an
industrial plant in connection with the new district workhouse and
reformatory is being considered by the commissioners.
The plan under consideration is to have school furniture, garbage
cans and a variety of articles which the district annually is forced to
buy manufactured at the plant.
With the object of determining the feasibility of the scheme,
Commissioner Judson recently visited the Hampton Industrial
Agricultural Institute, at Hampton, Va., where he observed the
manufacturing methods that are employed as a part of the course
taught in the school.
It is the opinion of Commissioner Judson that the establishment of
an industrial plant by the District, the labor to be supplied by the
reformatory prisoners, will prove both practicable and economical.
In the event of the plan materializing, the District, it is said, may
sell the articles manufactured at the plant to the different
departments of the local government, but may not dispose of them to
outside buyers. It was stated today that the commissioners will soon
endeavor to secure a new reformatory site.
A “Hobo Army.”—During the first day of September a much-
heralded army of the unemployed “descended” on Washington.
Thousands had been announced by James Eads How, who for years
has been with evident sincerity trying to organize the vagrants of this
country into a union. Mr. How’s army numbered at the most several
hundred in Washington. The deliberations of the conference
furnished space writers of summer newspaper stories with material.
But, as the Elizabeth (New Jersey) Journal says: “So far as any
impression on the national congress is concerned, the self-styled
hoboes might as well have met in Atlantic City.”
Yet there is a real significance in the repeated efforts of James
Eads How to organize his hobo brotherhoods in St. Louis, Chicago,
New York and elsewhere. His organization efforts seem futile, but his
almost fanatical persistency has attracted more newspaper attention
to the fact of an ever-present vagrant army that will not work than
has any other public event in this field, unless it be the campaign in
New York in 1911 for a farm colony for habitual tramps and vagrants.
How is pushing the vagrancy problem into the foreground, but
perhaps not in the way he imagines.
The Nemesis of Finger Prints.—An editorial in the New York
Times of September 5th states that the evidence of guilty finger
prints has hitherto been little used in criminal trials. No one has been
convicted upon such evidence unsupported by other proof, although
in a case of burglary a few months ago the corroborative testimony
was supplied by the felon’s confession, made after he had compared
the telltale whorls photographed upon the window pane of his
victim’s house with his confirmatory digits. A grand jury has this week
for the first time returned an indictment upon recorded prints on file
at the central office of detectives which are reported to be identical
with the faint impressions upon a dusty case found in a loft that had
been looted by their stealthy maker. If he is convicted, Captain
Faurot of the Police Department’s Bureau of Identification will have
won a notable triumph.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
textbookfull.com

More Related Content

PDF
Programming PHP 4th Edition Peter Macintyre
PDF
Programming PHP 4th Edition Peter Macintyre 2024 scribd download
PDF
Php my sql programing - brochure
PDF
Learning Java An Introduction to Real World Programming with Java Marc Loy
PDF
Python-for-DevOps-Learn-Ruthlessly-Effective-Automation-by-Noah-Gift_-Kennedy...
PDF
Web Development with Node and Express Leveraging the JavaScript Stack 2nd Edi...
PDF
Web Development with Node and Express Leveraging the JavaScript Stack 2nd Edi...
PDF
(Ebook) High Performance Python by Micha Gorelick, Ian Ozsvald
Programming PHP 4th Edition Peter Macintyre
Programming PHP 4th Edition Peter Macintyre 2024 scribd download
Php my sql programing - brochure
Learning Java An Introduction to Real World Programming with Java Marc Loy
Python-for-DevOps-Learn-Ruthlessly-Effective-Automation-by-Noah-Gift_-Kennedy...
Web Development with Node and Express Leveraging the JavaScript Stack 2nd Edi...
Web Development with Node and Express Leveraging the JavaScript Stack 2nd Edi...
(Ebook) High Performance Python by Micha Gorelick, Ian Ozsvald

Similar to Get Programming PHP 4th Edition Peter Macintyre free all chapters (20)

PDF
High Performance Python 2nd Edition Micha Gorelick
PDF
(Ebook) Programming TypeScript: Making Your JavaScript Applications Scale by ...
PDF
High Performance Python 2nd Edition Micha Gorelick Ian Ozsvald
PDF
Data Management at Scale Best Practices for Enterprise Architecture 1st Editi...
PDF
Complete Download Web Development with Node and Express 2nd Edition Ethan Bro...
PDF
Learning Java An Introduction to Real World Programming with Java Marc Loy
PDF
Instant download Data Management at Scale Best Practices for Enterprise Archi...
PDF
Web Development with Node and Express 2nd Edition Ethan Brown
PDF
(Ebook) Data Management at Scale: Best Practices for Enterprise Architecture ...
PDF
(Ebook) Python for DevOps: Learn Ruthlessly Effective Automation by Noah Gift...
PDF
Data Management at Scale Best Practices for Enterprise Architecture 1st Editi...
PDF
Data Management at Scale Best Practices for Enterprise Architecture 1st Editi...
PDF
Infrastructure as Code 2nd Edition Early Access Kief Morris all chapter inst...
PDF
Infrastructure as Code 2nd Edition Early Access Kief Morris
PDF
(Ebook) Data Management at Scale: Best Practices for Enterprise Architecture ...
PDF
Opentext exstream dialogue online training | Opentext exstream dialogue train...
PDF
Mongodb The Definitive Guide 3rd Edition 3rd Edition Kristina Chodorow Eoin B...
PDF
Progressive EPiServer Development
PDF
Continuous Delivery in Java Essential Tools and Best Practices for Deploying ...
PDF
Get Master Web Design with HTML CSS JavaScript and jQuery Create Stunning Int...
High Performance Python 2nd Edition Micha Gorelick
(Ebook) Programming TypeScript: Making Your JavaScript Applications Scale by ...
High Performance Python 2nd Edition Micha Gorelick Ian Ozsvald
Data Management at Scale Best Practices for Enterprise Architecture 1st Editi...
Complete Download Web Development with Node and Express 2nd Edition Ethan Bro...
Learning Java An Introduction to Real World Programming with Java Marc Loy
Instant download Data Management at Scale Best Practices for Enterprise Archi...
Web Development with Node and Express 2nd Edition Ethan Brown
(Ebook) Data Management at Scale: Best Practices for Enterprise Architecture ...
(Ebook) Python for DevOps: Learn Ruthlessly Effective Automation by Noah Gift...
Data Management at Scale Best Practices for Enterprise Architecture 1st Editi...
Data Management at Scale Best Practices for Enterprise Architecture 1st Editi...
Infrastructure as Code 2nd Edition Early Access Kief Morris all chapter inst...
Infrastructure as Code 2nd Edition Early Access Kief Morris
(Ebook) Data Management at Scale: Best Practices for Enterprise Architecture ...
Opentext exstream dialogue online training | Opentext exstream dialogue train...
Mongodb The Definitive Guide 3rd Edition 3rd Edition Kristina Chodorow Eoin B...
Progressive EPiServer Development
Continuous Delivery in Java Essential Tools and Best Practices for Deploying ...
Get Master Web Design with HTML CSS JavaScript and jQuery Create Stunning Int...
Ad

Recently uploaded (20)

PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Trump Administration's workforce development strategy
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Cell Types and Its function , kingdom of life
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Pharma ospi slides which help in ospi learning
Final Presentation General Medicine 03-08-2024.pptx
Trump Administration's workforce development strategy
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
VCE English Exam - Section C Student Revision Booklet
Cell Types and Its function , kingdom of life
Supply Chain Operations Speaking Notes -ICLT Program
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Weekly quiz Compilation Jan -July 25.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Anesthesia in Laparoscopic Surgery in India
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
A systematic review of self-coping strategies used by university students to ...
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
202450812 BayCHI UCSC-SV 20250812 v17.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
human mycosis Human fungal infections are called human mycosis..pptx
Pharma ospi slides which help in ospi learning
Ad

Get Programming PHP 4th Edition Peter Macintyre free all chapters

  • 1. Download the Full Version of textbook for Fast Typing at textbookfull.com Programming PHP 4th Edition Peter Macintyre https://textbookfull.com/product/programming-php-4th- edition-peter-macintyre/ OR CLICK BUTTON DOWNLOAD NOW Download More textbook Instantly Today - Get Yours Now at textbookfull.com
  • 2. Recommended digital products (PDF, EPUB, MOBI) that you can download immediately if you are interested. Learn Java for Android Development: Migrating Java SE Programming Skills to Mobile Development 4th Edition Peter Späth https://textbookfull.com/product/learn-java-for-android-development- migrating-java-se-programming-skills-to-mobile-development-4th- edition-peter-spath/ textboxfull.com Programming Language Concepts Peter Sestoft https://textbookfull.com/product/programming-language-concepts-peter- sestoft/ textboxfull.com Lumen Programming Guide Writing PHP Microservices REST and Web Service APIs 1st Edition Paul Redmond (Auth.) https://textbookfull.com/product/lumen-programming-guide-writing-php- microservices-rest-and-web-service-apis-1st-edition-paul-redmond-auth/ textboxfull.com Programming WCF Services 4th Edition Juval Löwy https://textbookfull.com/product/programming-wcf-services-4th-edition- juval-lowy/ textboxfull.com
  • 3. Programming in Lua 4th Edition Roberto Ierusalimschy https://textbookfull.com/product/programming-in-lua-4th-edition- roberto-ierusalimschy/ textboxfull.com Pro Functional PHP Programming Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity Aley https://textbookfull.com/product/pro-functional-php-programming- application-development-strategies-for-performance-optimization- concurrency-testability-and-code-brevity-aley/ textboxfull.com Pro Functional PHP Programming: Application Development Strategies for Performance Optimization, Concurrency, Testability, and Code Brevity Rob Aley https://textbookfull.com/product/pro-functional-php-programming- application-development-strategies-for-performance-optimization- concurrency-testability-and-code-brevity-rob-aley/ textboxfull.com Computer Programming and Utilization, 4e 4th Edition E. Balagurusamy https://textbookfull.com/product/computer-programming-and- utilization-4e-4th-edition-e-balagurusamy/ textboxfull.com Advanced Apex Programming in Salesforce 4th Edition Dan Appleman https://textbookfull.com/product/advanced-apex-programming-in- salesforce-4th-edition-dan-appleman/ textboxfull.com
  • 6. 1. Foreword 2. Preface a. Audience b. Assumptions This Book Makes c. Contents of This Book d. Conventions Used in This Book e. O’Reilly Online Learning f. How to Contact Us g. Acknowledgments i. Kevin Tatroe ii. Peter MacIntyre 3. 1. Introduction to PHP a. What Does PHP Do? b. A Brief History of PHP i. The Evolution of PHP ii. The Widespread Use of PHP c. Installing PHP d. A Walk Through PHP i. Configuration Page ii. Forms iii. Databases iv. Graphics e. What’s Next 4. 2. Language Basics a. Lexical Structure
  • 7. i. Case Sensitivity ii. Statements and Semicolons iii. Whitespace and Line Breaks iv. Comments v. Literals vi. Identifiers vii. Keywords b. Data Types i. Integers ii. Floating-Point Numbers iii. Strings iv. Booleans v. Arrays vi. Objects vii. Resources viii. Callbacks ix. NULL c. Variables i. Variable Variables ii. Variable References iii. Variable Scope iv. Garbage Collection d. Expressions and Operators i. Number of Operands ii. Operator Precedence iii. Operator Associativity iv. Implicit Casting
  • 8. v. Arithmetic Operators vi. String Concatenation Operator vii. Auto-Increment and Auto-Decrement Operators viii. Comparison Operators ix. Bitwise Operators x. Logical Operators xi. Casting Operators xii. Assignment Operators xiii. Miscellaneous Operators e. Flow-Control Statements i. if ii. switch iii. while iv. for v. foreach vi. try...catch vii. declare viii. exit and return ix. goto f. Including Code g. Embedding PHP in Web Pages i. Standard (XML) Style ii. SGML Style iii. Echoing Content Directly h. What’s Next 5. 3. Functions a. Calling a Function
  • 9. b. Defining a Function c. Variable Scope i. Global Variables ii. Static Variables d. Function Parameters i. Passing Parameters by Value ii. Passing Parameters by Reference iii. Default Parameters iv. Variable Parameters v. Missing Parameters vi. Type Hinting e. Return Values f. Variable Functions g. Anonymous Functions h. What’s Next 6. 4. Strings a. Quoting String Constants i. Variable Interpolation ii. Single-Quoted Strings iii. Double-Quoted Strings iv. Here Documents b. Printing Strings i. echo ii. print() iii. printf() iv. print_r() and var_dump()
  • 10. c. Accessing Individual Characters d. Cleaning Strings i. Removing Whitespace ii. Changing Case e. Encoding and Escaping i. HTML ii. URLs iii. SQL iv. C-String Encoding f. Comparing Strings i. Exact Comparisons ii. Approximate Equality g. Manipulating and Searching Strings i. Substrings ii. Miscellaneous String Functions iii. Decomposing a String iv. String-Searching Functions h. Regular Expressions i. The Basics ii. Character Classes iii. Alternatives iv. Repeating Sequences v. Subpatterns vi. Delimiters vii. Match Behavior viii. Character Classes ix. Anchors
  • 11. x. Quantifiers and Greed xi. Noncapturing Groups xii. Backreferences xiii. Trailing Options xiv. Inline Options xv. Lookahead and Lookbehind xvi. Cut xvii. Conditional Expressions xviii. Functions xix. Differences from Perl Regular Expressions i. What’s Next 7. 5. Arrays a. Indexed Versus Associative Arrays b. Identifying Elements of an Array c. Storing Data in Arrays i. Appending Values to an Array ii. Assigning a Range of Values iii. Getting the Size of an Array iv. Padding an Array d. Multidimensional Arrays e. Extracting Multiple Values i. Slicing an Array ii. Splitting an Array into Chunks iii. Keys and Values iv. Checking Whether an Element Exists v. Removing and Inserting Elements in an Array f. Converting Between Arrays and Variables
  • 12. i. Creating Variables from an Array ii. Creating an Array from Variables g. Traversing Arrays i. The foreach Construct ii. The Iterator Functions iii. Using a for Loop iv. Calling a Function for Each Array Element v. Reducing an Array vi. Searching for Values h. Sorting i. Sorting One Array at a Time ii. Natural-Order Sorting iii. Sorting Multiple Arrays at Once iv. Reversing Arrays v. Randomizing Order i. Acting on Entire Arrays i. Calculating the Sum of an Array ii. Merging Two Arrays iii. Calculating the Difference Between Two Arrays iv. Filtering Elements from an Array j. Using Arrays to Implement Data Types i. Sets ii. Stacks k. Implementing the Iterator Interface l. What’s Next 8. 6. Objects
  • 13. a. Objects b. Terminology c. Creating an Object d. Accessing Properties and Methods e. Declaring a Class i. Declaring Methods ii. Declaring Properties iii. Declaring Constants iv. Inheritance v. Interfaces vi. Traits vii. Abstract Methods viii. Constructors ix. Destructors f. Anonymous Classes g. Introspection i. Examining Classes ii. Examining an Object iii. Sample Introspection Program h. Serialization i. What’s Next 9. 7. Dates and Times a. What’s Next 10. 8. Web Techniques a. HTTP Basics b. Variables c. Server Information
  • 14. d. Processing Forms i. Methods ii. Parameters iii. Self-Processing Pages iv. Sticky Forms v. Multivalued Parameters vi. Sticky Multivalued Parameters vii. File Uploads viii. Form Validation e. Setting Response Headers i. Different Content Types ii. Redirections iii. Expiration iv. Authentication f. Maintaining State i. Cookies ii. Sessions iii. Combining Cookies and Sessions g. SSL h. What’s Next 11. 9. Databases a. Using PHP to Access a Database b. Relational Databases and SQL i. PHP Data Objects c. MySQLi Object Interface i. Retrieving Data for Display
  • 15. d. SQLite e. Direct File-Level Manipulation f. MongoDB i. Retrieving Data ii. Inserting More Complex Data g. What’s Next 12. 10. Graphics a. Embedding an Image in a Page b. Basic Graphics Concepts c. Creating and Drawing Images i. The Structure of a Graphics Program ii. Changing the Output Format iii. Testing for Supported Image Formats iv. Reading an Existing File v. Basic Drawing Functions d. Images with Text i. Fonts ii. TrueType Fonts e. Dynamically Generated Buttons i. Caching the Dynamically Generated Buttons ii. A Faster Cache f. Scaling Images g. Color Handling i. Using the Alpha Channel ii. Identifying Colors iii. True Color Indexes
  • 16. iv. Text Representation of an Image h. What’s Next 13. 11. PDF a. PDF Extensions b. Documents and Pages i. A Simple Example ii. Initializing the Document iii. Outputting Basic Text Cells c. Text i. Coordinates ii. Text Attributes iii. Page Headers, Footers, and Class Extension iv. Images and Links v. Tables and Data d. What’s Next 14. 12. XML a. Lightning Guide to XML b. Generating XML c. Parsing XML i. Element Handlers ii. Character Data Handler iii. Processing Instructions iv. Entity Handlers v. Default Handler vi. Options vii. Using the Parser
  • 17. viii. Errors ix. Methods as Handlers x. Sample Parsing Application d. Parsing XML with the DOM e. Parsing XML with SimpleXML f. Transforming XML with XSLT g. What’s Next 15. 13. JSON a. Using JSON b. Serializing PHP Objects i. Options c. What’s Next 16. 14. Security a. Safeguards i. Filtering Input ii. Escaping Output Data b. Security Vulnerabilities i. Cross-Site Scripting ii. SQL Injection iii. Filename Vulnerabilities iv. Session Fixation v. File Upload Traps vi. Unauthorized File Access vii. PHP Code Issues viii. Shell Command Weaknesses ix. Data Encryption Concerns
  • 18. c. Further Resources d. Security Recap e. What’s Next 17. 15. Application Techniques a. Code Libraries b. Templating Systems c. Handling Output i. Output Buffering ii. Output Compression d. Performance Tuning i. Benchmarking ii. Profiling iii. Optimizing Execution Time iv. Optimizing Memory Requirements v. Reverse Proxies and Replication e. What’s Next 18. 16. Web Services a. REST Clients i. Responses ii. Retrieving Resources iii. Updating Resources iv. Creating Resources v. Deleting Resources b. XML-RPC i. Servers ii. Clients
  • 19. c. What’s Next 19. 17. Debugging PHP a. The Development Environment b. The Staging Environment c. The Production Environment d. php.ini Settings e. Error Handling i. Error Reporting ii. Exceptions iii. Error Suppression iv. Triggering Errors v. Defining Error Handlers f. Manual Debugging g. Error Logs h. IDE Debugging i. Additional Debugging Techniques j. What’s Next 20. 18. PHP on Disparate Platforms a. Writing Portable Code for Windows and Unix i. Determining the Platform ii. Handling Paths Across Platforms iii. Navigating the Server Environment iv. Sending Mail v. End-of-Line Handling vi. End-of-File Handling vii. Using External Commands viii. Accessing Platform-Specific Extensions
  • 20. b. Interfacing with COM i. Background ii. PHP Functions iii. API Specifications 21. Function Reference a. PHP Functions by Category i. Arrays ii. Classes and Objects iii. Data Filtering iv. Date and Time v. Directories vi. Errors and Logging vii. Filesystem viii. Functions ix. Mail x. Math xi. Miscellaneous Functions xii. Network xiii. Output Buffering xiv. PHP Language Tokenizer xv. PHP Options/Info xvi. Program Execution xvii. Session Handling xviii. Streams xix. Strings xx. URLs xxi. Variables
  • 21. xxii. Zlib b. Alphabetical Listing of PHP Functions 22. Index
  • 22. Praise for the 4th Edition of Programming PHP PHP 7 has rejuvenated the PHP ecosystem, providing a powerful mix of world- class performance and highly anticipated features. If you’re after the book that would help you unlock this potential, look no further than the new edition of Programming PHP! —Zeev Suraski, Cocreator of PHP By selecting Programming PHP you have taken that first step not only into PHP and its basics but into the future of website and web application development. With a firm understanding of the PHP programming language, and the tools available to you, the only limitations will be your imagination and your willingness to continue to grow and immerse yourself in the community. —Michael Stowe, Author, Speaker, and Technologist Covers all the details you’d expect in a programming language book and gets into more advanced topics that seasoned veterans would find interesting. —James Thoms, Senior Developer at ClearDev
  • 23. Programming PHP FOURTH EDITION Creating Dynamic Web Pages Kevin Tatroe and Peter MacIntyre
  • 24. Programming PHP by Kevin Tatroe and Peter MacIntyre Copyright © 2020 Kevin Tatroe and Peter MacIntyre. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or [email protected]. Acquisitions Editor: Jennifer Pollock Development Editor: Angela Rufino Production Editor: Christopher Faucher Copyeditor: Rachel Monaghan Proofreader: Tom Sullivan Indexer: Potomac Indexing, LLC Interior Designer: David Futato Cover Designer: Karen Montgomery Illustrator: Rebecca Demarest March 2002: First Edition April 2006: Second Edition February 2013: Third Edition March 2020: Fourth Edition
  • 25. Revision History for the Fourth Edition 2020-03-12: First Release See http://oreilly.com/catalog/errata.csp?isbn=9781492054139 for release details. The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Programming PHP, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc. The views expressed in this work are those of the authors, and do not represent the publisher’s views. While the publisher and the authors have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights. 978-1-492-05413-9 [LSI]
  • 26. Dedication To Jenn —KT I would like to dedicate my portions of this book to my still wonderful wife, Dawn Etta Riley. I love you! —PBM
  • 27. Foreword It’s hard to believe that nearly 20 years ago I picked up my first PHP book. I had an interest in programming, extending beyond Netscape Composer and static HTML. I knew PHP would enable me to create dynamic, smarter websites—and to store and fetch data to create interactive web applications. What I didn’t know was the journey that unlocking these new capabilities with PHP would take me on, or how PHP would evolve 20 years later to become the programming language powering roughly 80% of the web, and backed by one of the nicest, friendliest, and most engaging communities. A journey of a thousand miles begins with a single step. By selecting Programming PHP by Peter MacIntyre and Kevin Tatroe, you have taken that first step not only into PHP and its basics, but also into the future of website and web application development. With the available tools and a firm understanding of the PHP programming language, the only limitation will be your imagination and your willingness to continue to grow and immerse yourself in the community. The journey is yours, the possibilities endless, and the future for you to define. As you get ready to begin this journey, I would like to share a couple tidbits of advice. First, take each chapter and put it into practice, try different things, and don’t be afraid of breaking something or failing. While Programming PHP will establish a strong foundation, it’s up to you to explore the language and find new and creative ways to pull together all of these components. My second piece of advice: be an active part of the PHP community. Take advantage of online communities, user groups, and PHP conferences as you are able. As you try new things, share them with the community for their feedback and advice. Not only are you sure to find a community of support—a group of some of the nicest people, who want you to succeed and are more than happy to take their time to help you through your journey—but you’ll also establish a baseline of continuous learning, helping you grasp the core skills of PHP more quickly and keeping you up to date on new programming theories, technologies, tools, and changes. Not to mention, you’ll
  • 28. encounter an onslaught of terrible puns (including from yours truly). With that, I would like to be among the first to welcome you and to wish you the very best on your journey—a journey that couldn’t start off better than with this book! Michael Stowe, author, speaker, and technologist San Francisco, California, Winter 2020
  • 29. Preface Now more than ever, the web is a major vehicle for corporate and personal communications. Websites carry satellite images of Earth in its entirety; search for life in outer space; house personal photo albums, business shopping carts, and product lists; and so much more! Many of those websites are driven by PHP, an open source scripting language primarily designed for generating HTMLcontent. Since its inception in 1994, PHP has swept the web and continues its phenomenal growth today. The millions of websites powered by PHP are testament to its popularity and ease of use. Everyday people can learn PHP and build powerful dynamic websites with it. The core PHP language (version 7+) features powerful string- and array-handling facilities, as well as greatly improved support for object-oriented programming. With the use of standard and optional extension modules, a PHP application can interact with a database such as MySQLor Oracle, draw graphs, create PDF files, and parse XML files. You can run PHP on Windows, which lets you control other Windows applications (such as Word and Excel with COM) or interact with databases using ODBC. This book is a guide to the PHP language. When you finish it (we won’t tell you how it ends!), you will know how the PHP language works, how to use the many powerful extensions that come standard with PHP, and how to design and build your own PHP web applications. Audience PHP is a melting pot of cultures. Web designers appreciate its accessibility and convenience, while programmers appreciate its flexibility, power, diversity, and speed. Both cultures need a clear and accurate reference to the language. If you are a (web) programmer, then this book is for you. We show the big picture of the PHP language,
  • 30. and then discuss the details without wasting your time. The many examples clarify the textual explanations; the practical programming advice and many style tips will help you become not just a PHP programmer, but a good PHP programmer. If you’re a web designer, you will appreciate the clear and useful guides to specific technologies, such as JSON, XML, sessions, PDF generation, and graphics. And you’ll be able to quickly get the information you need from the language chapters, which explain basic programming concepts in simple terms. This edition has been fully revised to cover the latest features of PHP version 7.4.
  • 31. Assumptions This Book Makes This book assumes you have a working knowledge of HTML. If you don’t know HTML, you should gain some experience with simple web pages before you try to tackle PHP. For more information on HTML, we recommend HTML & XHTML: The Definitive Guide by Chuck Musciano and Bill Kennedy (O’Reilly). Contents of This Book We’ve arranged the material in this book so that you can either read it from start to finish or jump around to hit just the topics that interest you. The book is divided into 18 chapters and 1 appendix, as follows: Chapter 1, Introduction to PHP Talks about the history of PHP and gives a lightning-fast overview of what is possible with PHP programs. Chapter 2, Language Basics Is a concise guide to PHP program elements such as identifiers, data types, operators, and flow-control statements. Chapter 3, Functions Discusses user-defined functions, including scope, variable-length parameter lists, and variable and anonymous functions. Chapter 4, Strings Covers the functions you’ll use when building, dissecting, searching, and modifying strings in your PHP code. Chapter 5, Arrays Details the notation and functions for constructing, processing, and sorting arrays in your PHP code. Chapter 6, Objects Covers PHP’s updated object-oriented features. In this chapter, you’ll learn about classes, objects, inheritance, and introspection. Chapter 7, Dates and Times
  • 32. Discusses date and time manipulations like time zones and date math. Chapter 8, Web Techniques Talks about techniques most PHP programmers eventually want to use, including processing web form data, maintaining state, and dealing with SSL. Chapter 9, Databases Discusses PHP’s modules and functions for working with databases, using MySQL database as examples. Also, SQLite and PDO database interface are covered. NoSQLconcepts are also covered here. Chapter 10, Graphics Demonstrates how to create and modify image files in a variety of formats from within PHP. Chapter 11, PDF Explains how to create dynamic PDF files from a PHP application. Chapter 12, XML Introduces PHP’s extensions for generating and parsing XMLdata. Chapter 13, JSON Covers JavaScript Object Notation (JSON), a standardized data-interchange format designed to be extremely lightweight and human-readable. Chapter 14, Security Provides valuable advice and guidance for programmers creating secure scripts. You’ll learn programming best practices to help you avoid mistakes that can lead to disaster. Chapter 15, Application Techniques Talks about coding techniques like implementing code libraries, dealing with output in unique ways, and error handling. Chapter 16, Web Services Describes techniques for dealing with external communication via REST tools and cloud connections. Chapter 17, Debugging PHP Discusses techniques for debugging PHP code and for writing debuggable PHP code.
  • 33. Chapter 18, PHP on Disparate Platforms Discusses the tricks and traps of the Windows port of PHP. It also discusses some of the features unique to Windows, such as COM. Appendix Serves as a handy quick reference to all core functions in PHP. Conventions Used in This Book The following typographical conventions are used in this book: Italic Indicates new terms, URLs, email addresses, filenames, and file extensions. Constant width Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords. Constant width bold Shows commands or other text that should be typed literally by the user. Constant width italic Shows text that should be replaced with user-supplied values or by values determined by context. NOTE This icon signifies a tip, suggestion, general note, warning, or caution. O’Reilly Online Learning
  • 34. Discovering Diverse Content Through Random Scribd Documents
  • 35. Russian or Polish Jews. Very many of the cases brought by the Jewish women are extremely difficult to handle owing to the fact that the desertion has oftentimes taken place in Europe. A man living in the ghetto of Warsaw or Bialystok or Wilna will decide to come to America to seek his fortune. Not having money enough to bring his wife and family, he starts out alone leaving behind him the assurances that he will return for them, or will send them money to bring them over. As a rule two or three letters at least are sent back to the old country, containing money orders for little sums of money, then the letters will cease. Sometimes the wife waits for four or five or six years before in despair she sets out in quest of her husband. Sometimes she finds him married to some American woman or some woman he has met over here, and then she goes to court with her trouble. The law here is confronted with the situation obviously impossible to handle with equal justice to all parties concerned without working hardship somewhere. The wife from the Old World with her children certainly has first claim upon the man, but at the same time the wife whom he has married here has perhaps married him in good faith, knowing nothing about the other family, and so have her children been born. The Italians are the second largest nationality in the classification of the domestic relations court cases. The Italians are very apt to be disorderly persons. They are hot tempered, quick to strike and a great many times an Italian wife appeals to the domestic relations court because her husband has been cruel to her and struck her, and this court is obliged to send her to the magistrates court in order that her husband may be treated as a disorderly person. In justice to the Italians of Northern Italy, it should be stated that it is very rare to find an Italian in the domestic relations court who originally came from any province in Italy north of Rome. The great mass of Italians who get into this court are Neapolitans, Calabrians and Sicilians. The third group are from Central Europe, Hungarians, peoples from the Balkan states, Galicia and other provinces of Austria. The French rarely are obliged to appeal to the domestic relations court. The French are naturally a home-loving people, and anything like a domestic break is rare among them. Only two or three times since this court was established have French couples been obliged to
  • 36. appear there. A great many people classify themselves as Americans when as a matter of fact they are foreign born, so that the figures in regard to the number of Americans in this court are misleading. Negroes, however, turn up here in great numbers. Colored men often have no sense of responsibility whatever and they are constantly forsaking their wives and families or going off with somebody else’s wife. The excuses offered by colored men who are haled into this court are often very amusing. For the most part, however, this is not an amusing court. The long line of people who press before Judge Cornell and Judge Harris day after day, is for the most part a sordid, hideous line, and the tales the complainants tell fill one with contempt and sourness toward humanity. The domestic relations court offers an even seamier picture of life in this city than the magistrates courts. While it is true that occasionally a family of the better class makes appeal to this court, for the most part the clients are illiterate and very poor. A very large per cent. of the cases that are brought here are people who, if abandoned, would become public charges. That is why the state interests itself to the extent of providing a counsel for complainants, in order to protect itself from the burden of caring for helpless women and little children, whom some individual has simply deserted. There are people who pretend to find amusement in the rehearsal of the marital woes of the poor. To be sure, occasionally a case turns up with its funny side, but to me the recitals are heartbreaking and dreary. In the state of New York the failure of a man to support his wife, if there are no children, the crime ranks as a misdemeanor, and six months in the workhouse is the maximum penalty which can be imposed upon him. The domestic relations court, in specializing on this phase of law, will undoubtedly lead to certain reforms and amendments to the existing law tending ultimately to develop a system of domestic relations jurisprudence. It is a great boon, as it stands today, to suffering poor women. Any woman without a dollar in the world can walk into the domestic relations court, tell her troubles to the clerk of the court, and then if her case is a worthy one, she is within a few minutes placed on the witness stand, where
  • 37. she can repeat the recital to the judge. The whole proceeding of bringing her husband to the bar of justice and getting the court to forcing him to provide for her is speedy and absolutely without cost. A woman under our present system of life ought to have a court of this kind in which she may take refuge, because the world at large is, at the present time, so unfair to women. A woman can serve a man for years, bear him a large family of children, and suddenly be deserted and left with the burden of support for herself and family on her. If her husband is faithless, all she can do is to appear before the supreme court and apply for a divorce, but in this domestic relations court the judge will make her husband contribute to her support and to the support of his children. Drink is frequently at the bottom of domestic troubles, but not nearly so often as most people would think. Drink, especially whiskey, frequently makes a man irritable and quarrelsome, which leads to family rows and frequently to disorderly conduct. The greatest number of cases that come into this court are against shiftless, worthless, idle men who seem to belong naturally to the submerged tenth. One day this week I sat with Judge Cornell for an entire session of the court and the run of cases which appeared that day gave ample indication of the tone of the court. One case was of a colored girl who has been married less than a year, who had brought her big black husband into the court to explain why he had abandoned her. The explanation was frankly given. He was so accustomed to living with white women, he said that he could not bring himself to live any longer with the wife of his own color. He was bonded to pay his wife $1 a week. Another woman, neat, pretty and intelligent, a California girl, not yet twenty, had had her husband arrested because he insisted that she go on the streets and make money, not only for herself but for him, as a public prostitute. An Irish woman complained that her husband who made good wages drank it all up. He countered by stating, under oath, that his wife was an habitual drunkard, which made no impression whatsoever on the court, because the woman was particularly prepossessing and without a single incriminating mark upon her. There were the usual number of Jewish women whose husbands had simply gone off saying they would have nothing more to do with them. And one or
  • 38. two Italian women, with small babies in their arms, whose husbands had got angry with them and put them out of the house or struck them. It is a miserable, pitiable phase of life that one sees in the domestic relations court, but that the court is so overworked, so constantly busy, is justification enough for its establishment and indication that any large community requires some such institution to placate and bring together men and women, husbands and wives, whom oftentimes trifling difficulties are about to separate, and to make it impossible for husbands to desert their wives with impunity. That there should be only three such courts in this country is a striking commentary on the life we lead when it has been proved and demonstrated so extraordinarily by the domestic relations court in New York city that the need is so great. A visit to the domestic relations court will not insure a pleasant afternoon or an amusing hour, but it will prove an enlightening experience.
  • 39. IN THE PRISONERS’ AID FIELD PRISONERS’ AID WORK IN CALIFORNIA The San Francisco Post reports that: “A statement of the work of the California prison commission during the past year shows that a remarkable number of men and women, who have been released from prison, have been given employment by this organization through the good work that is being accomplished at Golden Rule Hall. At this place those who have been discharged from prison are provided for until suitable employment is found for them. “During the past year 465 have been placed in positions, an average of nine a week. Of these 26 were over 60 years of age, and four over 80. Fourteen consumptives were placed either in positions of light employment or in homes or hospitals. More than 200 were sent direct from prison to employment; others, who were either invalids, cripples, or aged, were temporarily boarded at Golden Rule Hall. Another good office of the commission is to look after the wives and children of prisoners. “All of this work has entailed a great deal of expense. The building and equipment of Golden Rule Hall, to take the place of the building that was destroyed by fire, has put the organization into debt. An appeal is being made to the public to lessen this difficulty, and to help along an institution that is doing much toward preventing a repetition of crimes by ex-convicts.” As to the renovation of San Quentin prison, the Post says:
  • 40. “Within a few months the new 800-room concrete and steel cellhouse now in course of construction at San Quentin prison will be completed. “The building is a prison within a prison, and is a class A structure, 600 feet in length and 60 feet in height. The cells are built in the center of the structure and run its full length. There are four tiers with 200 cells on a tier. Four hundred of these cells are separated by steel bars and are so arranged that twenty-five may be bolted at the same time. Eight hundred prisoners may be locked up three minutes after they reach the inside of the prison. “The walls and the cells of the new prison are built of reinforced concrete and in every foot of concrete steel bars are laid, running parallel and perpendicular, making it impossible for a prisoner to cut through at any point of his cell. “All the steel and iron work was turned out by the prisoners. Every part of the new building was manufactured and erected by prison labor. The roof of the structure is of copper and slate and has been pronounced by experts to be of the finest workmanship. The inside is finished with plaster and so clever is the workmanship that it resembles enamel work. “Work is now being done on a wall sixty feet high and six feet thick by the prisoners. This will surround the cellhouse. Upon completion an electric light plant and heating apparatus will be installed. “Warden Hoyle plans when the new cellhouse is ready for occupancy to put his new grading system into execution. The new prison will house all the first termers and they will not mingle with second and third term convicts. Each grade will have a separate yard and under the first grade the prisoners will wear a uniform. “The second termers will be together and wear a different kind of a uniform. The third grade will consist of life termers and hardened criminals. These will wear stripes. “The first-grade prison will be known as the reformatory, and at any time a prisoner’s deportment is bad he will be sent into the
  • 41. second-grade prison.” SUPPORTING A GOOD WARDEN The Prisoners’ Aid Society of Baltimore has recently taken up the cudgels for the retention in office of Charles A. Hook, warden of the Baltimore city jail. A letter to the mayor of Baltimore details some of the improvements effected by Warden Hook. “The citizens of Baltimore have every reason to be proud of this their one definite penal institution. It has reached an excellence of administration and a physical condition that place it easily among the foremost institutions of similar nature throughout the country. The improvements have been very marked, and from simply a correctional and detentional institution it has been transformed into a place of real helpfulness and reformation. “This state of efficiency is the direct result of the wise, practical and broad-spirited administration of its warden, Mr. Charles A. Hook. Warden Hook is a student of criminology. He has taken advantage of every opportunity to meet the wardens of other institutions and gathered from these conferences that which would be helpful to his own administration. “It is becoming more and more evident that the administration of a penal institution should be as scientifically based as the administration of a medical infirmary, and no greater boon can be conferred for the welfare of the municipality than the removal of this office from political influence. “To state concretely some of the very many improvements of this institution I would name the following: “The addition of 328 new concrete cells for men and women, with all modern improvements for hygiene and sanitation.
  • 42. “New hospital and operating room in the main building. “A library for the prisoners. “New hot water system for bathing purposes. “New beds made especially in the institution for the purpose of extreme cleanliness. “New sterilizing plant for infected clothing. “New baths and clothes rooms for prisoners. “New four-story workshop, of brick and cement. “New jail workshop, where articles used by the prisoners are made. “The substitution of machinery for the hands of the prisoners in the bakeshop. “In the moral features of the institution: “No official is now allowed to strike a prisoner except in self- defense. “All cases of infringement of rules are settled by the warden himself. “Dark cells and shower baths for punishment abolished. “All prisoners have the ear of the warden and he gives every Sunday morning to visitation and the consideration of personal requests and grievances. “Prisoners working in the shops with sentences of three months or over are allowed one-fourth of their earnings, one-half payable during confinement and the remainder on release. “Through the personal interest of the warden and his assistants a large share of the amount earned by the prisoners during confinement is paid to their families. “The definite result of these marked improvements in the physical condition and the moral and spiritual administration is very apparent in the number of inmates who are brought to realize the possibilities
  • 43. of a better life through reformation, and by this specific work the population of the jail is smaller than it has been in past years. “Every co-operation and sympathy have been granted the work of the Prisoners’ Aid Association by Warden Hook and his assistants, and through this co-operation a splendidly large number of men and women are being returned to society law-abiding and self- respecting.”
  • 44. EVENTS IN BRIEF [Under this heading will appear each month numerous paragraphs of general interest, relating to the prison field and the treatment of the delinquent.] Congress of Juvenile Court Judges.—Eight hundred invitations are being sent out by Judge Muir Weissinger and his advisory board of the Juvenile Court, for the third annual conference of juvenile court judges of the central states to be held in Louisville November 14, 15 and 16. The invitations go to judges in Kentucky, Tennessee, Indiana, Ohio, Illinois, Michigan, Missouri, Kansas, Oklahoma and Colorado. Special invitations are issued to officials of institutions in Kentucky interested in juvenile corrections and the juvenile judges in other states are asked to bring with them such probation officers and other officials as may wish to attend the conference. Reformatory versus Prison.—That the proper classification of prisoners is of basic importance in any effort to reform and rehabilitate them, and that courts are often parties to the creation of almost insuperable difficulties in this regard is shown in a recent article in the Rahway (New Jersey) Herald: D. George Wight, commissioner of charities and correction of New Jersey finds that there is no uniform rule under which the common pleas judges of the state deal out sentences. There are a number of first offenders in the state prison who should have been sent to the reformatory, and there are numerous cases where prisoners should have been sent to the state prison instead of the
  • 45. reformatory. Dr. Wight also shows that there are a number of hardened criminals confined in the reformatory. The out-of-place presence of these detained persons interferes with the work in the prison and in the reformatory. Mr. Osborne, warden of the state prison, concludes that reformation is an almost impossible achievement in the state prison, and Dr. Moore, superintendent of the state reformatory, is of the opinion that the presence of hardened criminals in the reformatory prevents the carrying on of efficient reformatory work in his institution. Under the existing laws it is provided that the male first offenders between the ages of 16 and 30 years shall be sent to the reformatory. Notwithstanding the provisions, Dr. Wight’s statistics show that from June, 1909, to June, 1911, there were committed to the state prison 240 prisoners of the first offender class, and less than 25 years of age. Dr. Wight shows that this total is twenty-five per cent. of the commitments during the two years which the statistics cover. There have been 231 commitments to the Rahway reformatory in the past year, and of this number at least fifty-five per cent. are second offenders, and some of the men are serving their third and fourth terms in prison. The report of Dr. Moore shows that of the commitments in the past year sixty-nine are second offenders, thirty-three are third offenders, eighteen are fourth offenders, five are fifth offenders and six are sixth offenders, leaving 104 first offenders committed during the year, with a total of 234. The investigation shows that the sentences imposed by the trial judges have not been based upon the seriousness of the crime, but upon the individual preferences of the court. A Prison Program for New York.—Commissioner Frank E. Wade, of Buffalo, has embodied the results of a recent careful inspection of the county penitentiaries of New York (New York, Albany, Onondaga, Monroe and Erie) in well digested reports to the commission, and in addition recommends a policy of action for the state which deserves
  • 46. quoting. For years the inefficient county management of most of the penitentiaries has been notorious. “Control of the penitentiaries under existing conditions is essentially a state function. The prospects, however, of state ownership are not promising for some time to come. The initial cost will be so great that, in the present condition of state finances, the proposition for the purchase of these institutions is not likely to meet with favor; furthermore, there are some related problems which should be settled before state ownership of penitentiaries. I refer to a state farm for vagrants, a reformatory for male misdemeanants between the ages of 16 and 21 and the development of industries in the penitentiaries. “The state is already committed to the farm colony plan and its successful operation will decrease the number in the penitentiaries of the most hopeless class of inmates as far as penitentiary treatment is concerned. “A state reformatory for misdemeanants, where boys between the ages of 16 and 21 can be committed on an indeterminate sentence and receive instruction in trades and letters, is the most necessary and urgent prison reform under public discussion. These boys can now be committed only to penitentiaries and jails, except in the city of New York, and the penitentiary and jail associations and treatment confirm them in criminal habits. “The introduction and extension of industries in the penitentiaries is of vital importance. The present idleness of the prisoners in all the penitentiaries (except New York and Onondaga county penitentiaries, where the product can be increased fifty per cent) is tending to destroy their future usefulness and turn them into loafers. It is the duty of the state commission of prisons to present the evils of this idleness to the public and to endeavor to have the county authorities furnish employment for all the prisoners, as required by law. “The enactment of a law permitting the superintendent of prisons to market the product of the penitentiaries will be of great assistance. Staple industries could then be established and industries
  • 47. supplementary to those in the state prisons could be installed in the penitentiaries. “The proposition of paying prisoners or their families a portion of the earnings is involved in the development of the industries in the penitentiaries. At present the idleness and the heavy cost of maintenance will not permit such payments, but if the earnings of prisoners were materially increased a substantial percentage might be given.” Mr. Hall on Prison Reform.—Albert H. Hall, who has the gift of “speakin’ out in meetin’” to some purpose, outlined at the recent annual conference of the American Institute of Criminal Law and Criminology what Minnesota has recently done, and recommended a law which has been enacted this year in his own state. He stated the provisions of that law, giving the reasons for each. All sentences, except for treason or murder in any of the degrees, shall be indeterminate: they shall be without limit of time. A board of parole is established, with the prison warden as a member ex-officio, to observe the prisoners, study them minutely, inquire into their history and watch their tendencies and their motives, and learn all about them. With this knowledge about them, the board establishes a record of marks, giving credit for merits and charge for derelictions, and on the basis of such register the board may release the prisoner on parole when it deems it expedient. The prisoners are to be provided with the rules and regulations, enabling them to score themselves, if they like, and giving them the right of a hearing before the board if they think the official score does not give them full credit. In order that all shall be treated absolutely alike, petitions from outside persons for the release of any prisoner will not be received or acted upon. The initiative is to rest with the board, and it may modify its conditions of parole during the period the prisoner remains under its observation. The prison warden is made a member of the board because of his intimate knowledge of the prisoners.
  • 48. Another feature of the proposition is that the prisoner loses his citizenship when he is sentenced, and its restoration rests with the governor, to whom the board of parole is to certify when it grants an absolute release, stating the reasons for the release. Addressing himself to the merits of the general proposition, Mr. Hall declared that the deterrent of crime is not the punishment, but the fear of conviction. What any person respects more than anything else is his honor, and he shrinks from being branded as a criminal. The system proposed puts him on his own honor and gives him hope and ambition. Changes at Atlanta.—Widespread newspaper attention has been given to proposed changes at the Federal prison at Atlanta. Hereafter the emphasis will be placed upon reformation instead of on punishment. The convicts will no longer be regarded as dangerous and unmanageable animals, to be subjected only to hard labor, coarse diet and various degrees of punishment, but they will be treated as men: men facing a future filled with the opportunity of reformation, and the influences of prison life will be directed towards the development of their manhood and the creation of new hope in their bosoms. In the prosecution of this new plan a prison library will be inaugurated, a school established, concerts given by a band to be formed among the inmates and games permitted in the leisure hours. Good behaviour will be rewarded by increased opportunities for instruction and amusement; bad conduct will be punished by curtailment of privilege. A Governor to Stump for Prison Reform.—The Boston Advertiser reports that Gov. Foss having pardoned 51 convicts, and broken the record, will make prison reform an issue on the stump. He says:
  • 49. “I have pronounced ideas on the subject. I have received many letters commenting favorably on the reforms that I suggested in my address before the American Bar Association. Massachusetts is standing still on the treatment of its prisoners. “There are hundreds of so-called criminals in the prisons who may be cured just as people in hospitals are cured of disease. “Only a very small number of the men in prison are habitual criminals. I don’t wish my ideas to be misinterpreted. Some of my political opponents are attempting to picture me as opening the doors of the prisons. As a matter of fact, I have very decided ideas on the protection of the public from the habitual criminal. “There are many men in the prisons, however, who commit crime when under the influence of liquor. They become brutes when under the influence of liquor, but when sober and temperate are perfectly normal, first-class citizens who may become a credit to their various communities.” Transferring Prisoners.—A recent Auburn (N. Y.) newspaper item states that forty-four prisoners were that day transferred to Comstock prison, a journey of about 200 miles. “At 9.30 the prisoners were manacled by twos, with handcuffs on their wrists, and short lengths of chain between their feet, making the act of walking as difficult as a three-legged race. They were marched by twos to the outside prison gate, and lined up while the guards placed themselves in position. At the word, the gate swung back, and the line of gray suits filed out, with a guard in blue at the side of every ten or twelve men. Marching to the New York Central station across the street, each man carrying a small bundle containing a few private belongings, they waited for the train which was half an hour late. A crowd of morbidly curious quickly rushed to the spot. “When the train finally pulled in, the prisoners were marched up the steps of a special car and down the aisles in regular order. Some difficulty was experienced in getting the men, impeded as they were, up the car steps, and they all smiled at the bystanders as if they
  • 50. were enjoying the little trip in the open air. The guards took up their positions inside the car, the doors were locked, and the train pulled out, leaving the crowd to comment upon the late spectacle.” Germany’s methods could teach us much by comparison. Transfer of prisoners is specially frequent because in Prussia practically all persons are under a central authority, the department of justice, which transfers prisoners according as fluctuations of population in the prisons occur. By arrangement with the railroads— which in Prussia are under governmental control and operation— specially constructed railway prison cars are attached to early morning or late evening trains, the cars being so constructed as not to afford public display of the prisoners. From the interior of the prison the prisoners are conveyed in vans to the railway stations. So important and frequent are these transfers that a small corps of prison department officials are assigned solely to this special work. This is a “made in Germany” humane plan that deserves our contemplation. A Michigan Prison Farm.—The Detroit (Mich.) News prints the following editorial, entitled “Prison Farm Redemption”: The state at large has not heard more encouraging news of progress in any of its institutions than Warden Simpson sets forth in his report on the management and operation of the prison farm at Jackson. The farm is not a big one—only 30 acres in extent—and it admits of little more than experimenting. But the warden and his charges have done some important work on it in the summer now ending. They have grown cabbages, peas, beets, parsnips, carrots, onions, radishes, lettuce, cucumbers, sweet corn and tomatoes enough of the staples to supply the prison for a whole year, and enough of the seasonal produce to give the prisoners fresh vegetables during the summer. One of the new silos will be filled with the ensilage from the green corn. The shelves in the fruit cellars hold 5,000 quarts of canned strawberries, while the memory of seven “feeds” of fresh berries and cream, not to mention shortcake, still
  • 51. lingers with the prisoners. Fifty bushels of huckleberries have been picked from the prison farm marsh. When the tomatoes and apples are ripe, 5,000 gallons of them will be put up for the winter table. In four months 133 hogs have been fattened and slaughtered, yielding 22,077 pounds of fresh pork. All this has been done at a monetary profit to the state. For the bigger profit reference is made to the warden’s own words: “The inmate working upon the farm, in addition to his useful service, is forming for himself habits of industry, growing fond of his work, perhaps to the extent of following this vocation at the time of his parole and release, thus taking him away from questionable haunts and evil associates known to him of former years in his city home. In my opinion there is no work, trade or calling to which men striving for a livelihood may fall heir, so conducive to the development of health, happiness, honesty and independence, combined with all the attributes of a good citizen, as practical and successful farming.” The Montpelier (Vt.) Jail.—The Review mentioned briefly the remarkable success of Sheriff Tracy of Montpelier, Vermont, in allowing his prisoners to go out to work for farmers and other employers. In the Atlantic Monthly for August Morrison I. Swift tells interestingly of the results lately: “The state of Vermont contains a prison where the inmates are treated upon a novel plan. They are trusted and treated like other human beings; they come and go almost as freely as the members of the jailer’s own family; so far as possible, whatever suggests punishment or disgrace is banished, and they are made to feel that their imprisonment is designed to improve them as men and to restore them to social life not only with full self-respect but with the cordial respect of the community. “This great innovation in prison practice was made possible by a state law authorizing all sheriffs to set their prisoners at work either
  • 52. inside or outside the jails. In Montpelier, where this prison stands, the inveterate prejudice against prisoners has been swept away. “As late as two or three years ago, when the men did not return promptly to the jail at the time appointed the sheriff would become nervous and go out to walk the streets looking for them. That is all past now, not only because of the unsuspected traits of human nature that experience has unfolded but because of the marvellous practical success of the system. During the four years, out of 800 prisoners treated upon the new plan only two attempted to escape, both of whom were recaptured and sentenced to long terms in the house of correction for betraying the trust reposed in them. With such a record as this the sheriff no longer feels perturbed if his entire corps of prisoners is scattered in every direction during the day, and he is perfectly assured that at night they will reappear at the jail. “During the whole period their labor earned above $6,000, of which a total exceeding $2,600 was kept by themselves. As a rule the men have carefully saved their money, limiting permitted purchases for themselves to send it home to those dependent on them.” Intemperance and Imprisonment Causes of Poverty.—Just at the time when a board of inebriety has been appointed in New York, the New York Association for Improving the Condition of the Poor, one of the largest and oldest relief societies of this country, announces the results of a statistical study, commented upon thus in the New York World: “Only two families in every hundred of the 1,573 which have been in the care of the Association for Improving the Condition of the Poor this summer were brought to poverty through intemperance. The percentage goes against preconceived notions and is indeed surprisingly small. It should disturb that prosperous complacency which sees in poverty only or mainly the penalty of wanton misdeed. The association’s report for 1909 showed that intemperance,
  • 53. imprisonment, desertion, ‘shiftlessness and inefficiency,’ all told, accounted for not 12 per cent of those brought to want. “The figures for that year showed that 65 per cent of the poverty was due to two causes—sickness and unemployment. This summer the two causes account for 68 per cent of the poverty noted, and 43 per cent, or nearly half, was due to sickness alone. Here are causes of misery which society can abate or largely remove and the economic evils of which it can provide against through some form of insurance.” Prison Labor in District of Columbia.—The establishment of an industrial plant in connection with the new district workhouse and reformatory is being considered by the commissioners. The plan under consideration is to have school furniture, garbage cans and a variety of articles which the district annually is forced to buy manufactured at the plant. With the object of determining the feasibility of the scheme, Commissioner Judson recently visited the Hampton Industrial Agricultural Institute, at Hampton, Va., where he observed the manufacturing methods that are employed as a part of the course taught in the school. It is the opinion of Commissioner Judson that the establishment of an industrial plant by the District, the labor to be supplied by the reformatory prisoners, will prove both practicable and economical. In the event of the plan materializing, the District, it is said, may sell the articles manufactured at the plant to the different departments of the local government, but may not dispose of them to outside buyers. It was stated today that the commissioners will soon endeavor to secure a new reformatory site.
  • 54. A “Hobo Army.”—During the first day of September a much- heralded army of the unemployed “descended” on Washington. Thousands had been announced by James Eads How, who for years has been with evident sincerity trying to organize the vagrants of this country into a union. Mr. How’s army numbered at the most several hundred in Washington. The deliberations of the conference furnished space writers of summer newspaper stories with material. But, as the Elizabeth (New Jersey) Journal says: “So far as any impression on the national congress is concerned, the self-styled hoboes might as well have met in Atlantic City.” Yet there is a real significance in the repeated efforts of James Eads How to organize his hobo brotherhoods in St. Louis, Chicago, New York and elsewhere. His organization efforts seem futile, but his almost fanatical persistency has attracted more newspaper attention to the fact of an ever-present vagrant army that will not work than has any other public event in this field, unless it be the campaign in New York in 1911 for a farm colony for habitual tramps and vagrants. How is pushing the vagrancy problem into the foreground, but perhaps not in the way he imagines. The Nemesis of Finger Prints.—An editorial in the New York Times of September 5th states that the evidence of guilty finger prints has hitherto been little used in criminal trials. No one has been convicted upon such evidence unsupported by other proof, although in a case of burglary a few months ago the corroborative testimony was supplied by the felon’s confession, made after he had compared the telltale whorls photographed upon the window pane of his victim’s house with his confirmatory digits. A grand jury has this week for the first time returned an indictment upon recorded prints on file at the central office of detectives which are reported to be identical with the faint impressions upon a dusty case found in a loft that had been looted by their stealthy maker. If he is convicted, Captain Faurot of the Police Department’s Bureau of Identification will have won a notable triumph.
  • 55. Welcome to our website – the ideal destination for book lovers and knowledge seekers. With a mission to inspire endlessly, we offer a vast collection of books, ranging from classic literary works to specialized publications, self-development books, and children's literature. Each book is a new journey of discovery, expanding knowledge and enriching the soul of the reade Our website is not just a platform for buying books, but a bridge connecting readers to the timeless values of culture and wisdom. With an elegant, user-friendly interface and an intelligent search system, we are committed to providing a quick and convenient shopping experience. Additionally, our special promotions and home delivery services ensure that you save time and fully enjoy the joy of reading. Let us accompany you on the journey of exploring knowledge and personal growth! textbookfull.com