PHP scripts in Java desktop applications
This task is easily implemented using the ' and ' classes. /tutorials/thebridge/ shows a J2SE/PHP application with the same function as before. You can test this application at a command prompt:
The following is the quoted content:
?gt;java –classpath {place here the application classpath} Javaphp
Java comes with a tool called jrunscript, which can use it to assign values to PHP scripts from Java, such as: jrunscript -l php {phpFile}.php As in the following script: <?php |
You can run jrunscript like this:
The following is the quoted content:
..> jrunscript -l php |
Work better
This article only gives a brief introduction to PHP/Java bridge. I hope it will be helpful to you. PHP/Java bridge builds an interoperable bridge between the two high-level programming languages PHP and Java. If you think this technology is helpful to your project, don’t hesitate and start doing it!