Core PHP Programming

My first book was published in May, 1999. A second edition followed in August, 2000. The third edition was published in August 2003.  You may wish to download the Core PHP Listings (e.g. Examples, Source Code).  You may also wish to review the 3/E Errata page.  Errata for previous editions is still available: Core PHP Programming 1/E Errata, Core PHP Programming 2/E Errata.

There were two nice reviews of previous editions.

14 replies on “Core PHP Programming”

Terry: I can’t think of an easy, simple way to do what you’re asking. Someone may have written functions that take arrays and turn them into images using the GD library. Or you might find a command-line utility that renders HTML into images that you could shell out to from PHP.

I looked through the book for an example of what I want to do but could not find it. I would like to be able to display a large table generated from mysql
and php as an image of what would be normally displayed by the html
that php generates. Is there an easy way to do this? I am using the html
table function to create a large table with a border. I want the png or
jpg image to look the same as the html table.

Zulfiqar: your function is missing something that my example has, namely a check that the variable (count) is set. If you try to increment a variable that doesn’t exists, whether it’s PHP 4 or PHP 5, you should expect to get an error message.

Dear sir,
In Core PHP 5 book, the example in Arguments Section, Where default Arguments Section with reference variable is not working…..


is giving error….

any solution…

i have installed php 4 version

here is my function…sorry about above mistake…
“function xyz(&$count)
$c =0 ;

//output is 1”

Dear Leon,
I just started reading your PHP 5 Core Programming book, I found it usefull for me… but as well as i am at the starting..i found some bugs in your coding and one error in programming… following are the details..

1. Mis-printing (may be in my side…)
on page number 87, you have defined three functions, which are:
1. func_get_arg
2. func_get_args
3. func_num_args
it is written further that you will find these in Chapter 8, but these functions are not available in Chapter 8, but instead, these are available in Chapter 11 on page number 412-414.

2. Error in programming…(function is not working)
following function which is on page number 86, listing 4.8 is given error…
function printColor($text, $color=”black”, &$count=NULL)
Error is:
“Parse error: parse error, unexpected ‘=’, expecting ‘)’ in C:\FoxServ\www\arg2.php on line 2”

But regarding to this i mean referencing variable, i wrote my own little function with one arguments…(variable reference)
following is an example:

this one is working when $count=0, but not working with &$count=NULL OR &$count=0, giving me same error as i mentioned above…

please inform me about that…
I will be very thankfull to you…

thinking you…

I have been reading through your book (CORE PHP 3rd Edition) to get a better understanding on how to work with Mssql through PHP. I have recently fell into a bit of a jam on 17.8 it talks about a function called mssql_set_message_handler() which is very brief. I looked all over to find some help with using this. I found sybase version of it which says
(Note: This function is only available using the CT library interface to Sybase, and not the DB library). My question to you is you listed this as a mssql function on 718 was this a error? or is there a way to do this. If it was an error is there a way I can use FreeTDS and enable this function? Any help would be appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *