PHP

   »    Free PHP book resources & Tutorials

Computer Education, Training & Tutorial Resources - ComputerEducationWorld.com
Home » Free Computer Books » PHP »

Instead of slowly explaining some of the building blocks of the scripting
engine, this section dives into coding an extension, so do not worry if you don’t
see the whole picture right away.
Imagine you are writing a web site but need a function, which will repeat
a string n times. Writing this in PHP is simple: (more…)


• • •
 

“If the code and the comments disagree, then both are probably wrong.”–
Norm Schryer

One of the main reasons for PHP’s success is the large amount of available
extensions. No matter what a web developer might need, he’ll most probably
find it in the PHP distribution, including extensions that support various
databases, graphic file formats, compression, XML technologies, and lots
more. (more…)


• • •
 

Sometimes, it is just not possible to optimize a piece of PHP code. The code is
as fast as it possibly can be in PHP, but it may still be a bottleneck. This is the
time to wield your axe, chop it to bits, and rewrite it in C as a PHP extension.
If you have some C skills, it’s not that hard. Consult Chapter 15, “An Introduc-
tion to Writing PHP Extensions,” for examples. (more…)


• • •
 

This section covers techniques for finding miscellaneous optimizations, includ-
ing micro-benchmarks, rewriting PHP code in C, and writing procedural ver-
sus object-oriented code.

Micro-Benchmarks
Often, you may find yourself wondering which approach is the fastest. For
example, which is faster–str_replace() or preg_replace()–for a simple
replacement? You can find the answer to many of these questions by writing a
little micro-benchmark that measures exactly what you are looking for.
The following example is a library file (ubm.php) to run micro-benchmarks,
followed by an example benchmark that tells you which is faster: (more…)


• • •
 



captcha PHP Script Free PHP captcha script free php
Website Design by WebWalas.com