21.0 Introduction


When Rasmus Lerdorf created PHP, he intended it to be a macro language rather than as a full-fledged programming language. In its original inception, the functions and features were written in C and then simply called from PHP. By version 4, PHP has become a full-fledged programming language, and a good part of fully utilizing PHP is knowing how to work with the Zend API to create your own functions and extensions.

In this chapter, we discuss the Zend API, which is the API that enables you to add functions and extensions in PHP. If you don't know C, you really won't be able to understand this chapter. So, I suggest you learn C, and then reread this chapter. We first cover the basics ”getting function arguments, modifying function arguments, adding your function to PHP ”and then move into more advanced topics such as managing resources, fetching resource identifiers, creating a Zend module, and adding that module to the build system. The culmination of our work will be to discuss PHP's curl module.



PHP Developer's Cookbook
PHP Developers Cookbook (2nd Edition)
ISBN: 0672323257
EAN: 2147483647
Year: 2000
Pages: 351

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net