All modern languages allow you to send and receive data, no matter from which language is sent or received. Many large applications (such as Facebook API), work with simple methods such as POST
, GET
, PUT
, DELETE
, etc., that is a REST API, returning the data in a specific format (JSON
, XML
, RAW
, etc.). This is innecessary if your application is a little piece of code, but you could take this idea and make something simple. So, there is nothing wrong if you are using the POST
method, but just in case, I can name you other resources that you could take advantage of.
You can use WebClient.
Also, you can comunicate your PHP code with your Java code using sockets.
Of course, you can use cURL too. For Java you can read this question and connect with php. If your application is very large and complex in the PHP side, I guggest you to use Laravel.