954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How can i call c++ functions in php?

I have to call some c++ functions in php files. how can i create an extention dll which will work with php.

vrgopakumar
Newbie Poster
2 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 

If you are using php on a linux machine you can use the system function.

http://uk2.php.net/manual/en/function.system.php

Or if you are using Windows machines, you can use shell_exec function.

http://uk2.php.net/shell_exec

example:
[PHP]$Info = explode("\n", shell_exec(".\\progs\\program.exe"));
[/PHP]
Will dump the output of program.exe in folder /progs/ to $Info using next line carriage as the exploder/seperator.

Hope that helps :)

ReDuX
Junior Poster
127 posts since Sep 2004
Reputation Points: 12
Solved Threads: 5
 

there is a techniq to do this using ext_skel
thank u.

vrgopakumar
Newbie Poster
2 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 

is this like runing a c++ program from php...? is tht possible....???
can i a run a different program all together.... thru a php fuction.. run a c++ program?

tinudeshmukh
Newbie Poster
3 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 
there is a techniq to do this using ext_skel thank u.

kindly clarify this ext_skel method
thank u

tinudeshmukh
Newbie Poster
3 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

wow, didn't about that, nice, thanks

theighost
Junior Poster
103 posts since Jan 2009
Reputation Points: 8
Solved Threads: 15
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You