PHP and C++ API

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
magicstarmike
Forum Newbie
Posts: 1
Joined: Thu Jul 20, 2006 3:03 pm

PHP and C++ API

Post by magicstarmike »

Can someone tell me if it is possible to make calls to a C++ API from within PHP? If so, how?

I am developing a GUI in PHP and need to make calls to an API written in C++ in order to
retreive data to be displayed in the GUI.

Any help would be greatly appreciated.


Thanks in advance,
magicstarmike
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Read the user comments on this page of the PHP manual. I am not a C programmer, but there are many who frequent this community so I am sure someone can answer this question better than me.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If the API can be called via: command line or COM or local port, php doesn't need external help, but if the API does not support any of those, you'll need to build an interface to perform one or more of these actions. This interface may be best done by creating an extension that php can load, along with the API to make the calls for you. PHP may have an interface already for this API, which are you working with?
Post Reply