c with php
am 22.10.2007 17:46:30 von goldnery
Hi every one,
I have a function writen with c and I need to use her on my php
script.
I understood that their is away to do so, since php writen with c
language, but i don't know how.
does someone have a clue?
thanks!
Re: c with php
am 22.10.2007 20:10:08 von Jerry Stuckle
Gandalf wrote:
> Hi every one,
> I have a function writen with c and I need to use her on my php
> script.
> I understood that their is away to do so, since php writen with c
> language, but i don't know how.
> does someone have a clue?
>
> thanks!
>
>
If you want to just call it as a function, you can write an extension to
PHP to make it available. Or if you can run it as a standalone program
passing and receiving values, you can call the executable via exec() or
similar.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: c with php
am 23.10.2007 23:30:11 von colin.mckinnon
On 22 Oct, 16:46, Gandalf wrote:
> Hi every one,
> I have a function writen with c and I need to use her on my php
> script.
> I understood that their is away to do so, since php writen with c
> language, but i don't know how.
> does someone have a clue?
>
> thanks!
Never done it myself but the process seems to be well documented - you
could do worse than start here:
http://www.php.net/manual/en/internals2.php
Of course if its not going to be heavily used/republished it might be
simpler to just write your own wrapper in C to make a standalone
executable then comunicate between it and PHP using stdio
(proc_open()) or sockets.
HTH
C.