how to write php function

前端 未结 3 1397
無奈伤痛
無奈伤痛 2021-01-03 10:12

i want to know how i can write php function in c (like strtoupper). if is there any tutorial please put it here

thanks

3条回答
  •  我在风中等你
    2021-01-03 10:54

    To write a function in C, that can be used from PHP, you'll have to write an extension.

    There are not that many informations about that available, unfortunatly...

    Still, searching through my bookmarks, here are the links I found :

    • Extension Writing Part I: Introduction to PHP and Zend
    • Extension Writing Part II: Parameters, Arrays, and ZVALs
    • Extension Writing Part II: Parameters, Arrays, and ZVALs [continued]
    • Extension Writing Part III: Resources
    • Wrapping C++ Classes in a PHP Extension

    And, if you are really interested by the subject, and ready to spend some money on it, you could buy the book Extending and Embedding PHP (some pages are available as preview on Google Books too) ; I've seen a couple of times that it was the book to read when interested on this subject (In fact, I've bought it some time ago, and it's an interesting read)

    BTW, the author of that book is also the author of the first four articles I linked to ;-)

提交回复
热议问题