开发者

PHP and Java interoperablity

开发者 https://www.devze.com 2022-12-28 05:22 出处:网络
I am working on windows using tomcat 6 and PHP/Java Bridge. I know how t开发者_运维问答o access a Java file from PHP but how do we do it the other way i.e accessing PHP from Java

I am working on windows using tomcat 6 and PHP/Java Bridge. I know how t开发者_运维问答o access a Java file from PHP but how do we do it the other way i.e accessing PHP from Java

<?php
require_once("java\Java.inc");
$systemInfo = new Java("java.lang.System");
print "Total seconds since January 1, 1970: 
".$systemInfo->currentTimeMillis();
?>

Also how do I access Java classes that are created by me. Do I write a CLASSPATH env variable or change the php.ini config file?


I think you should look at JPHP, which embeds PHP into the Java VM.

0

精彩评论

暂无评论...
验证码 换一张
取 消