You can start a program using the exec, system etc.functions (read the manual)
how you exchange data is up to you.
You can give your program some data through the commandline or you can use command arguments.
You can fetch data back using the stdin/out
of you could even use sockets if you feel brave enough.