100% found this document useful (2 votes)
154 views

Download ebooks file Programming PHP 4th Edition Peter Macintyre all chapters

PHP

Uploaded by

tvoyrasika
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
154 views

Download ebooks file Programming PHP 4th Edition Peter Macintyre all chapters

PHP

Uploaded by

tvoyrasika
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Experience Seamless Full Ebook Downloads for Every Genre at textbookfull.

com

Programming PHP 4th Edition Peter Macintyre

https://textbookfull.com/product/programming-php-4th-
edition-peter-macintyre/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://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
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 HTML content.

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 MySQL or 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.
NoSQL concepts 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 XML data.
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


Another Random Scribd Document
with Unrelated Content
thread when contraction takes place after the web comes through
the press rolls.
The feature which is aimed at, and which is most desirable in the
appearance of such goods, is a clean cut prominent rib at the rubber
line, and the avoidance of a flat paper-like look and feel of the web
generally. The prominence of the rib varies, of course, according to
the size of the rubber thread used, and the binder warp employed in
dividing the same, but even the very best of conditions may be
spoiled if proper care is not taken to get all the prominence of rib
possible. Use as fine a binder warp as is practicable, compensating
for any loss of weight or excess of contraction by using a heavier
gut, which again of itself helps to fill in the rubber cavity and thereby
lends additional prominence to the rib. All the weight possible should
be carried on the binder warp up to a point of safety, and care should
be taken to get a very easy, uniform delivery of the warp from the
beam so as to avoid any erratic jerky movement of the warp lever.
The warp beams which are used on this delicate type of work
should be well balanced and true to center, and the flanges free from
any irregularity which would in any way interfere with the easy and
uniform operation of the warp lever.
The gut, which weaves in with the rubber thread, is used for the
two-fold purpose of giving additional body to the fabric and of
regulating in a measure the length of stretch in the goods. The more
gut there is used, the less becomes the power of contraction of the
rubber warp, and the shorter the stretch produced.
Aside from the fineness and body of the goods, the element of
stretch largely governs the market value of the fabric, so that good
judgment and great care must be exercised in the assembling of the
different sizes of yarns used. Weft, binder and gut all play their part
in the governing of the stretch, as also does the number of picks put
in the goods. Any excess of weight on the binder warp also
materially reduces the stretch. In fact, any one of these features,
wrongly adjusted, may result in the difference between the profit and
loss.
In making the selvage of these goods a hard steel wire is used,
around which the filling passes at each pick. This wire, shown at W
in Fig. 6A, is highly tempered piano wire, of the very best quality
obtainable. Sharpened to a needle point at one end, with a loop
turned at the other end, it is fastened at the back of the loom by a
cord which has an adjustable slip knot, so as to be able easily and
quickly to regulate the length of wire running in the web. It is then
passed through a harness heddle eye on the rubber or gut shaft, and
through a reed space next outside the selvage rubber thread. The
constant wear of this wire on the reed dent makes it necessary to
have this dent of hardened steel so as to withstand the constant
wear of the wire, which is always being crowded against the dent by
the nipping action of the filling as it draws against the wire in the
process of weaving, and the repeated beat at the same place in the
dent at the weaving line. In any event, after a short time the dents in
the reed will be cut so that it becomes necessary to frequently
replace them with new ones, and for this reason it should be so
arranged that they can be easily and quickly removed from and
replaced in the reeds.

The Lisle Web


The lisle web, being perfectly plain, is similar in general character
to the loom web, except that it is made with high grade combed and
gassed yarns for the filling in place of cheaper stock used on the
loom webs, and is woven with four threads for the binder warp
between each strand of rubber, instead of two as in the loom web.
The harness draft of the one-half inch lisle web shown at Fig. 7,
together with the weave, is shown at Fig. 7A. The construction is as
follows: Binder, 36 ends 80/2; gut, 8 ends 40/2; rubber, 10 ends 32s;
reed, 21 dent; picks, 78 per inch; stretch, 75 per cent.
It will be seen that all the binder threads operate two up and two
down, but change at each pick in rotation, making the repeat every
four picks of the loom. In a weave of this character the changes of
the harness are distributed uniformly at each pick, thus making it
much easier to get uniform conditions on each selvage. It differs
from the loom web in this respect, where the alternating light and
heavy pick has to be contended with.
Like the loom webs, prominence of the rib over the rubber thread
is the main feature aimed at in the general appearance of the fabrics,
and therefore everything possible should be done which will
emphasize this. The binder warp must be of fine yarns, and the warp
must be weighted so as to cut the warp line down sharp and clear up
to a point of safety, being careful at the same time not to go to
excess so as to narrow in the goods or cause undue chafing of the
rubber warp. The yarn most generally used for filling is 26-2 comber
and gassed high grade stock, of about 15 turns per inch. It should be
a well-rounded lofty yarn so as to obtain all the covering property
possible. It should be spun with the utmost uniformity, as the
slightest irregularity in the yarn will be noticeable in the goods.
The dyeing and bleaching of the yarn used for filling is also of the
greatest importance. It is not an unusual occurrence to find
otherwise perfect goods made unmarketable as first class by the use
of a filling yarn which has not been properly processed. This faulty
condition of the yarn may be caused in a variety of ways; such as an
irregular boil, poor circulation of liquor in the kier, irregular drying,
etc. Even when the color appears to be perfect, poor processing will
often prevent the smooth running of the yarn from the shuttle,
causing it to drag and thus create irregular and crooked selvages
which result in the repeated breaking of the selvage rubber threads
and ruin the goods.
The many difficulties of this character which were encountered
when skein yarn was more generally used for filling led to the
introduction and almost general use of warp yarns for filling
purposes, inasmuch as the method of processing the warp yarns
gives results which are not nearly so variable. Furthermore the long
unbroken runs of thread obtainable by quilling avoid the many knots
which are present when using skein yarn. Knots are unsightly and
objectionable when appearing on the face of the goods.
Chafed and broken edge rubber threads, however, are not always
the result of the conditions named, by any means, but may be
caused by a variety of other things. Not infrequently the edge wire
may be weaving too long in the web so as not to draw out freely.
Sometimes it may be a bent wire that causes the trouble, or it may
be the rubber rolling around the wire. Many times defects are caused
by the edge wire having cut into the dent, so that it has a file-like
effect as the rubber thread passes by in weaving. All these things
require looking into, and when trouble comes the cause should be
found and not guessed at.

French Web or Railroad Weave


Another plain web which has attained considerable popularity, and
which is a kind of intermediate grade between the loom web and the
lisle, is what is known as the French web or railroad weave, shown
at Fig. 8. In almost all respects the general treatment of this web is
the same as already described, and it differs only in the draft, which
is shown at Fig. 8A. It allows for the use of a somewhat finer yarn
than is generally employed in the loom web, and the draft changes at
every two cords, which gives it a peculiar “rowey” appearance from
which it derives the name of railroad weave.
There is one feature associated with all these plain webs which it
might be well to speak of. The high tension at which it is necessary
to work the rubber warp, together with the light weight required on
the cotton warp and the crowding together of the picking, creates a
tendency for the goods to rebound at the front reed, accompanied by
a backward and forward sliding movement when passing over the
rod at the breast beam. This movement is liable to polish the goods,
which is an objectionable feature. To counteract this it is advisable to
let the web pass over a small, felt-covered wood tube, which
revolves and responds to the movement of the bounding web. In this
way there is no friction to glaze or polish the web and interfere with
the bloom of the yarn. The same polish will occur as the goods pass
through the press rolls, unless they are felt covered.

Cable Web
The most popular web now made up into men’s garters is what is
known as the cable web, shown at Fig. 9. With the pronounced
prominence of the two-dent rib, which gives it a character peculiarly
different from the plain web, it is well adapted to this class of goods.
Simple in appearance, it nevertheless requires special care to
manufacture, particularly when we remember that it is not unusual to
be required to make a finished stretch of not less than 100 per cent.
The harness draft and weave are shown at Fig. 9A. The construction
is as follows: Binder, 34 ends 80/2; Gut, 24 ends 20/2; Rubber, 18
ends 28s; Reed, 20 dent; Picks, 80 per inch; Stretch, 100 per cent.
The filling, floating across the wide spaces under which lie the
rubber threads in pairs, is very easily thrown out of place, the result
of which may be an unsightly seersucker appearance, as shown in
Fig. 10, which the process of finishing aggravates rather than
corrects.
Trouble may manifest itself by the filling over the ribs opening up
and allowing the gut threads to prick through. To prevent this
objectionable feature it is necessary to use a good quality of
moderately soft yarn for the gut, not necessarily of high grade stock,
but a yarn which is uniformly spun and not at all hard or wiry. As
these goods are being woven and on full stretch, the gut threads, of
course, are perfectly straight and accurate in line, but when
contraction takes place, to probably one-half the former length, these
heavy threads, which form probably about 25 per cent. of the weight
of the entire web, should bend or fold uniformly and dispose of
themselves in such a manner as not to appear in any way on the
face of the web, snugly housed away in the several pockets or
cavities. If the yarn composing these gut threads is spotty or
irregularly spun, this uniformity of fold inside the pockets will be
broken up and the appearance of the face of the goods is likely to be
marred by unsightly specks of cotton pricking through, which can be
both seen and felt.
Chapter IV.
Elaboration of Honeycomb Effects by Parti-Dyed and Printed Fillings
—Bandage and Surgical Webs Made with Plain and Covered
Rubber—Frill Web Woven on Cam Looms—Double Cloths—
Importance of Securing Balance Between Back and Face of Goods
Among the group of single cloth webs confined to the capacity of
plain looms, is what is commonly known as the honeycomb, shown
at Fig. 1 and Fig. 1A. This is generally made with silk, wood silk, or
schappe filling. The smooth filling floating over two cords gives the
web a smooth feel, there being no rib effect noticeable whatever,
making it well adapted for a fine trade. The warp lines are almost
entirely hidden by the filling, so that it is not practicable to introduce
any sharp stripe fancy effects, which can be done both in the plain
web and the cable. The honeycomb is thus confined to plain solid
colors or such elaboration as can be obtained from the filling.
Fancy effects are often secured by dyeing skein yarn in two or
more colors. Such yarns when woven in the goods produce
alternating effects at regular distances in different colors, such
distances being governed by the length of the dips and the width of
the goods. The effects which can be produced are quite varied. The
simplest way of accomplishing this is to use the regular 54-inch
skein, having white or some light shade as a base, and then dyeing
a given portion of the skein another color. This process is carried out
by hanging the skeins on sticks placed in a rack at the required
distance above the color liquor, and then lowering them into the vat
and dyeing the immersed part in the usual manner.
Where cotton is used for the filling and more elaborate effects are
desired, long reeled skeins are used, sometimes 108 or 216 inches,
which have been reeled on specially designed collapsible reels.
Such skeins are not practicable to handle in the dye house in the
manner already described. Sections of such skeins are wrapped in
heavy waterproof paper and tied tightly, so that the dye liquor cannot
penetrate that portion, and then the whole is put in the liquor, when
the exposed part only will be dyed.
Then again sometimes wood clamps are used, like that shown at
Fig. 2, having a recess into which part of the skein is laid after being
carefully folded. The two halves are clamped together tightly in such
a manner that the dye cannot penetrate the clamped part of the
skein while the part left outside the clamp is dyed when the whole is
immersed in the dye liquor.

Printed Filling
Another form of elaboration used in such goods is printing the
skein yarn used for the filling. This is done by using a machine
having a pair of fluted brass printing rolls, one of which is made to
open on a hinge like a gate so that a skein of yarn can be put around
it. This roller is then closed to its original position, so that with the
two rollers parallel and close together, and the skein of yarn hugged
tightly between them, the turning of the rollers imprints color on the
skein. The skein is then taken out and dryed before spooling.
Different sets of rolls are used so as to get fine and coarse effects
and various colors are used in printing.
Where plaid or printed fillings are used for the elaboration of webs
of the honeycomb type, it is not unusual to introduce a couple of
plain cords in the center of the web, or possibly on either side, so as
to break up the flatness of the weave. This opens up the opportunity
of using lines of a different color in the warp which properly arranged
will produce a plaid-like effect.
Fig. 1.—Honeycomb

Fig. 1A.—Harness Draft and Weave for Honeycomb.


Fig. 2.—Clamp Used for Dying Parti-Colored Skeins

Bandage Webs
There is quite a large demand for surgical and bandage webs, Fig.
3, in widths ranging from 2 to 4 inches. These webs are used for
binding the limbs and other purposes and are in the pure white or
natural yarns. They require to be made with a long soft easy stretch.
An open reed of about 12 dents per inch is employed. Four threads
are generally used for the binder, weaving two up and two down. The
goods are similar in construction to a regular lisle web, except that
the gut is omitted in order to get the easiest possible movement.
Fig. 3.—Bandage Webs; Fabric at Left Made with Plain Rubber; Web at Right
Made With Covered Rubber

The yarn is generally the same quality and size for both warp and
filling, and is usually a soft spun 2-20s. The side of rubber is
generally about 38 or 40, with 40 picks per inch and a finished
stretch of 100 per cent. The use such webs are put to, necessitating
as we have already said a soft and sluggish stretch, prevents the
use of a heavy rubber thread, the result being that when the
bandage is kept in close contact with the warm body, the life of the
fine rubber is of short duration.
This condition, and the open weave necessary to get the easy
stretch, have made it expedient to use in many of these goods
strands of rubber which have been covered with cotton threads
before weaving. This process not only prolongs the life of the web,
but allows for even more open weaving, the use of different weaves
than would be possible where the uncovered rubber thread is used,
and the production of a fabric more suitable for the purpose.
In order to get the soft easy stretch which is the most desirable
characteristic of a bandage web, and yet have the necessary width,
it is not unusual to introduce a seersucker effect, as shown in Fig. 4,
in sections of the web so as to reduce the strong elasticity of the
whole. In an ordinary cotton cloth the seersucker or crinkle effect is
usually produced by the use of a separate warp of heavier yarn than
the rest of the fabric, which warp must be weighted differently and
often a different weave is employed to emphasize the contrast in the
puckered seersucker effect.
In the elastic web all this special preparation is unnecessary.
Wherever the seersucker stripe is desired, strands of rubber are left
out which of course takes away from these portions that element
which contracts the other part of the web, and a seersucker effect is
the result. Such stripes are often used for the ornamentation of some
webs by having narrow sections introduced for border effects, or
running down the center, and in fact they may be employed in a
variety of ways, inasmuch as they lend themselves effectively to
different forms of coloring, in relief to the main fabric.

Fig. 4.—Seersucker Effect


Fig. 5.—Frill Web Made on Cam Loom

Fig. 6.—Plain Web

Fig. 6A.—Harness Draft and Weave for Fig. 6, Simplest Form of Double Cloth

In passing it might be well to note that where it is necessary to use


covered rubber threads special arrangements are required for
making the warps, as the covered thread cannot be handled like the
ordinary thread. The spools are placed in a rack which is required for
each warp. Arrangements have been made so that to each spool is
attached a special head, which can be weighted either by a lever
brake or weight attached to a cord running in a groove on the
auxiliary head. By this arrangement uniform delivery of the threads
can be made to the warp beam so as to avoid any puckering caused
by irregular warping.

Frill Web on Cam Loom


In single cloth webs as already stated, the scope for ornamental
effects is necessarily limited. The bulk of such webs, particularly
those made with a wire edge, are for the most part plain. There is a
type of garter web, however, characterized as “frill” and shown at
Fig. 5, which may be made within the narrow limitation of cam looms,
although the frill feature is more generally used in connection with
more elaborate fancy effects.
The frill part is practically a section of non-elastic of any desired
width woven on to a section of elastic, which likewise may be of
variable width. The strands of rubber used in the central section,
being woven under tension, contract this portion of the fabric after it
leaves the press rolls. The side sections having no rubber in them do
not contract, but frill up uniformly on either side of the web in regular
fluted folds. No wire is required for the selvage when a frill is made,
and the tension of the filling is adjusted so as to hug the outside
threads of the frill warp and make a neat selvage without narrowing it
in beyond the width of the reed space occupied by the warp.
The frill part must be on a separate warp, apart from the binder
threads which are used in the central section. The elastic section is
made in the regular manner already described for webs of four
harness capacity. The frill is likewise constructed from the same
harnesses, but the draft is so arranged that two of the harnesses are
used for one frill and two for the other. This arrangement is made in
order that the filling may only be bound in alternating picks on the frill
part, whereas in the body it is bound at every pick. This method
makes the frill soft and pliable, so that it readily responds to the
contraction which takes place in the body part, and thus makes for
regularity in the formation of the folds.
Should an exceptionally fine frill be desired, the same two
harnesses are used for the frill at either side, and the filling is bound
or woven in at each passage of the shuttle. Wherever this method is
employed, however, it becomes necessary to use a much finer yarn
for the frill warp, or a fewer number of threads spread over the front
reed in the frill. If such precautions are not taken the frill will be harsh
and stiff and will not fold uniformly as the center contracts. It may
even retard the desired contraction of the body.
It is not advisable in making frill webs to use a regular front reed
having the same spacing of dents all across. There is a liability of
getting a coarse looking frill, showing up the marks of the reed dents.
The plan more desirable is to use a reed with the dents required for
the frill part of the fabric spaced very much finer than those used for
the body, generally in the ratio of two to one, so that the frill threads
may be evenly distributed in ribbon-like formation and not show the
coarse lines of the dents.
Occasional calls are made for webs having a frill on one selvage
only. In this case it becomes necessary to use an edge wire on the
side having no frill, and exceptional care must be taken in this class
of goods to produce the proper balance. A soft frill is required and a
limited contraction of the body part.

Double Cloth Webs


Our remarks so far have been confined exclusively to single cloth
webs of a simple character, where, apart from the rubber and gut
there is only one warp used, and where both back and face of the
web are alike. We will now turn our attention to what are known as
double cloth webs, where two distinct cloths are woven, one for the
face and one for the back, each working independently of the other,
but tied together by another warp known as the binder, or else the
two cloths interlock each other in such a manner as to bind them
together without the assistance of another warp.
By this method of weaving much thicker and heavier webs may be
produced with a limitation of elasticity which cannot be obtained by
the single cloth method. The weaves and materials employed in the
face and back of the goods may be identical, or weaves of a different
character and stock of different qualities, sizes and colors may be
used. Fancy effects may be used to embellish the face, while the
back may be perfectly plain and free from any coloring whatever.
There are certain features associated with the construction of
double cloth webs which make them entirely different to deal with.
The different weaves and the different stock employed necessitate
splitting up the warps into sections to accommodate such conditions.
A separate warp is required for both back and face and also one for
the binder, which delivers a much greater length of warp than either,
necessitated by the character of the weave used in binding the upper
and lower cloths together. A separate warp is also required for the
gut, which goes in the web perfectly straight and is shorter in length
than any of the other sections. Such goods also require a special
warp for the selvage, so that in the simplest form of such webs a
bank of five warps is necessary. On fancy goods the introduction of
fancy warps may add to this number.

Balance Between Back and Face


The element of a right balance between the back and face has to
be considered, and if care be not taken in the proper adjustment of
the stock the result may be that one side of the goods will assert
control over the other in such a manner as to prevent it lying flat and
even. When such a web is cut it will curl up so as to be almost
uncontrollable. Such a condition may arise from a variety of causes.
If the weaves of the face and back cloths are identical then it will be
necessary to have the face and back warps of the same size yarn or
its equivalent. For instance, should the face be a four-thread plain
and 40/2 is used, and the back only two threads, then the yarn used
for the back warp must be 20/2 so as to equal the four threads of
40/2 in the face. Should, however, the face be a more open weave
than the back, then an equal weight of yarn in both cloths will not be
right, and it will be necessary to use yarn of a heavier weight for the
face to compensate for the freedom of the more open weave and
effect a proper balance with the more tightly woven back. There can
be no fixed rule to apply to this, and only experience will indicate the
proper relationship between the two. In Figs. 6 and 6A are shown the
simplest form of double cloth, known as a plain web.
By carefully following the weave it will be seen that while the face
weaves 3 up and 1 down, and the back 1 up and 3 down, the filling
will appear both on the face and back of the goods as 1 up and 1
down. If the binder was not there it would be a tubular web, having
the same appearance all around. The binder, however, intersects the
upper and lower cloths at each pick and binds the two together in
one complete whole, while the rubber lies between the two, each
strand being separated by the interlocking binder threads.
It becomes necessary in order properly to connect the upper and
lower cloths at their extreme edges to use a selvage warp, which as
will be seen in Fig. 6A is drawn in on all four face and back
harnesses, and the threads of which are arranged so as to complete
the weave all around. To do this it will be seen that there is an odd
thread at one side, otherwise the weave at this point would show two
threads operating together next to each other, and would break up
the continuity of the weave.
Fig. 7.—Method of Banking a Set of Warps for Double Cloth Webs

The selvage plays an important part in the structure and weaving


of the web. It forms the pocket for covering in which lies the outside
rubber threads, and it must be so arranged that these threads can
function properly so as to make a piece of goods that will lie flat. In
the first place the yarn must be of such a size that with the proper
number of threads employed the selvage will contract uniformly with
the body of the goods, so that the web will not “frill” on account of a
too heavy selvage, or “belly” because it is too light.

Care for Selvage


The threads must be properly divided in the front reed so as to
make a good clearance for the filling, which otherwise would “nib” up
and make an unsightly selvage. Then again, a careful adjustment of
the weight carried on the selvage warp must be made so as to
accommodate it to the requisite tension of the filling as it is delivered
from the shuttle, otherwise the edge rubber threads will be liable to
chafe and cut off when strained out of proper alignment with the front
reed. It will be observed in the draft that two rubber threads are used
in each selvage, which is necessary in order to control the additional
yarn used in the construction of the selvage.
Chapter V.
Three Leaf Twill or Satin Face Woven in Conjunction with Plain Back
—Position of Back Rolls in Relation to Harness Shed—Use of Four
Leaf Twill—Filling Fancy Effects and Stitch Figures—Interchanging
Figure and Face
Turning our attention from plain webs to combination weaves, we
will take up what is popularly known as the three-leaf twill, or satin
face, woven in conjunction with a plain back. This is a type of web
not only used for suspenders, but employed extensively for corset
garter attachments also. A web of this character when properly
constructed has a smooth velvet-like face. The threads are uniformly
distributed across the width without showing any of the “rowy” effect
from the binder warps, which are completely hidden by the heavy
pile produced by the float of the face threads. When the contraction
of the web takes place, these floating face threads mass together in
a velvet-like pile, not only producing a smooth handling web but
materially increasing the thickness. Such webs are generally
constructed with a six-thread face and a four-thread back, and have
what is termed a round edge, similar to the selvage used on a plain
web. This arrangement shows up the twill face by contrast and gives
the fabric a much finer appearance.

Harness and Chain Draft


Fig. 1 shows the harness and chain draft of such a web, together
with the construction of a properly balanced web for standard goods
of 1⅛ inches wide. It will be noticed that the face, consisting of 150
threads, is split up into two warps of 75 threads each. This
arrangement is necessary in order properly to weigh them so as to
get a good clearance in the shed. The warp has to be divided
likewise in the harnesses and put on six harness frames, although
the weave could be produced on three. It would not be practicable to
crowd 50 threads on one harness frame in the narrow space
available, as the harness eyes would shoulder and crowd too much
when changing.
In drawing-in this web, one face warp should be arranged so that
the threads are drawn on the first, third and fifth harnesses, and the
other face warp should be on the second, fourth and sixth. Such an
arrangement in the distribution of the warps makes it much easier on
the mechanism, and minimizes the risk of breakages. It is also
important to make proper divisions of the warps at the back rolls,
inasmuch as some of the warps have to be weighted heavily while
others are only lightly weighted, and also on account of the different
take-up of the varied weaves.
The back rolls should be set in a graded position so as to prevent
undue friction of one warp against another. The binder warp should
be worked under the front roll on account of the extremely light
weight this must carry. Fig. 2 shows the proper position of the back
rolls in relation to the harness shed.
In a web of this character where the warp stock is somewhat
crowded in the front reed, there is always a tendency for a fibrous
yarn to prevent a perfect clearance in the shed, with a liability of
producing occasional floats through the shuttle skipping these
threads. Such floats will pearl up when the web contracts and make
an imperfect face. This trouble may be prevented by setting the back
rolls a trifle higher than the breast beam rod, so that the stock in the
harness which is down will be slightly tighter than that which is in the
upper harness.
The chain draft is so arranged that the face harness will operate to
produce a twill which will be reverse to the twist of the yarn
employed, and thus reduce the prominence of the twill weave all
possible. The filling yarn should be soft, of about 15 turns per inch,
and of good uniform quality, in order to produce a nice selvage and
not cut the rubber. The reed dent inside the selvage rubber should
be carefully twisted at an angle to conform to the nipped in position
to the rubber thread, so that the outside edge of the dent will not cut
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

You might also like