i want to know how i can write php function in c (like strtoupper
). if is there any tutorial please put it here
thanks
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 :
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 ;-)
If you just want to call a C function from PHP, you could use Gearman as an intermediary.
http://gearman.org/
http://pecl.php.net/package/gearman (PECL package)
You might also be interested in SWIG, the Simplified Wrapper and Interface Generator:
SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. SWIG is used with different types of languages including common scripting languages such as Perl, PHP, Python, Tcl and Ruby.