Hi Michael, > It has been suggested to me in another forum to stay with the PHP > code, except > for the part that is running really s-l-o-w and code this in C/C++. > > How is this done? > > Does the PHP call another program or can I include C/C++ code in > the .php > file?
As Brenda mentioned, you can call a compiled C/C++ binary using shell_exec, the backtick operator, pcntl_exec, etc. The other way is to compile your C code into a PHP extension, which will let you run your code directly within PHP, but it can be faster and consume less memory than PHP code would (depending on exactly what you're doing). Sara Golemon wrote an apparently excellent book on the subject (I haven't read it myself) called Extending and Embedding PHP - but I'm not sure it's been revised for PHP5. Kind regards, James McGlinn __________________________________ CTO Eventfinder Limited Suite 106, Heards Building 2 Ruskin Street, Parnell, Auckland 1052 Phone: +649 365 2342 Mobile: +6421 633 234 [email protected] | www.eventfinder.co.nz --~--~---------~--~----~------------~-------~--~----~ NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected] -~----------~----~----~----~------~----~------~--~---
