Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 05-09-2009
Member
 
Join Date: Aug 2008
Posts: 129
How to call a C functions within PHP?

I have heard that calling C function within the PHP is possible How do we call C function in PHP? If anyone come across this please let me know. This will be an added information in my knowledge.
Reply With Quote
  #2  
Old 05-09-2009
Member
 
Join Date: Mar 2008
Posts: 232
Re: How to call a C functions within PHP?

We can call some of the C functions from PHP, like printf() fputs() fwrite() fgetc() exit() and so many others. You can write a SOAP webservice in C and then call it using PHP. But we cannot call all of C functions for example we cannot call initgraph() function that is a part of turbo C and I don't think that there is any way to call custom C functions from PHP
Reply With Quote
  #3  
Old 05-09-2009
Member
 
Join Date: Jan 2009
Posts: 143
Re: How to call a C functions within PHP?

Even though we can call C functions in php but at the same time You can't call a function inside another program written in totally different language in php. What you can do is you can write a program in c and call the program from command line with commandline arguments and echo the output. You could also make your own PHP module with the functions in it. Why do you want to call C functions within PHP?
Reply With Quote
  #4  
Old 05-09-2009
Member
 
Join Date: Jan 2009
Posts: 99
Re: How to call a C functions within PHP?

PHP has many native functions that have the same name as C functions and which act in similar ways but they are not C functions they are PHP functions. If you are using Windows and the API is contained within a DLL (which is often the case) then you could call it via rundll32, which you can call via the PHP system() function.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to call a C functions within PHP?"
Thread Thread Starter Forum Replies Last Post
Call entry stuck in Nokia C3-00 call log and stopped call logging Elijah*Blue Portable Devices 14 09-04-2012 02:49 PM
Call forwarding icon remain on screen after phone call in HTC Titan Nuru's Portable Devices 6 28-02-2012 10:21 PM
Making a call on blackberry gives - 'Call Forwarding - Conditional' popup silvery Portable Devices 6 23-10-2011 08:09 PM
Can I Define and Call my Own Functions in JavaScript? Rob Dizzle Software Development 5 09-02-2010 05:18 AM
Give information regarding jQuery CSS, AJAX and Call back Functions Jorgea Software Development 5 13-01-2010 09:29 PM


All times are GMT +5.5. The time now is 10:26 PM.