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.

Prentice Hall maintains a page about Core PHP where you can read the table of contents and read a sample chapter.

Safari is a subscription service that allows you to read electronic versions of many technical books. This includes Core PHP Programming.

I do not have plans to work on a fourth edition.

14 Responses to “Core PHP Programming”

  1. Jason says:

    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 php.net 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.

  2. The mssql version is just an alias of the sybase version. To get it working with FreeTDS, you need to specify –with-sybase_ct when you compile PHP.

  3. cl says:

    Great book. Thank you!

  4. Zulfiqar Ali Talpur says:

    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…

  5. Zulfiqar Ali Talpur says:

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

    //output is 1″

  6. Zulfiqar Ali says:

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

    &$count=NULL

    is giving error….

    any solution…

    i have installed php 4 version

  7. Leon says:

    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.

  8. Terry Todd says:

    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.

  9. Leon says:

    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.

  10. Hi,
    It is about listing 24-6 in CorePhp3edition.
    It sends an empty file.

    Thank.

    JPDaviau

  11. aahmed says:

    namespace?? in section 6.14 you talked about namespace in php5… where is that coming from? I tried several times running php script with namespace… it returns error. i couldn’t find any reference that php5 has name space… what am i doing wrong???

  12. Leon says:

    Aahmed: I wrote the book in advance of PHP 5 being final. There were namespaces in the betas of PHP 5, but they were removed a few weeks before the book was published. There was no opportunity to fix the chapter. I did note this in preface, but it’s easy to miss.

  13. Nelson says:

    Hi,

    Is there a 4th edition coming for Core PHP Programming (for PHP 6, for example)…?

  14. Leon says:

    No, no 4th edition coming. A few years ago, Prentice Hall replaced my book in the series with Core Web Application Development with PHP and MySQL.

Leave a Reply

Subscribe to RSS Feed Follow me on Twitter!