I have created a program but i need to get a java program to run a php script with some arguments and then get the php script to send some arguments to the Java program. I know this question has been asked a lot of times but it seems like the only answer i can get is that php can do this but java cant but there must be a way to do it. Right?
Asked
Active
Viewed 93 times
0
-
Never used it, but might be worth a look: http://quercus.caucho.com/ – MasNotsram May 16 '13 at 10:52
1 Answers
2
You can run PHP from the command line:
http://php.net/manual/en/features.commandline.php
This should enable your Java application to run it, and capture it's return values.

Borniet
- 3,544
- 4
- 24
- 33
-
I think it works but i really don't know a lot of php code so can you tell me how i can output the variables? – user2295443 May 16 '13 at 13:05
-
You can use return() for that: http://php.net/manual/en/function.return.php – Borniet May 16 '13 at 14:01