note 91455 added to java.examples-basic
| From: | anto dot justus at gmail dot com | Date: | Wed, 10 Jun 2009 17:00:51 +0000 |
| Subject: | note 91455 added to java.examples-basic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-156749@lists.php.net to get a copy of this message | ||
php java
The PHP code here is simple and straight forward. It is not
OOP. But you probably got enough of that while doing the
Java code.
java_require("F:\\wamp5\\www\\classes\\");
$obj = new Java("hello");
// Call the "sayHello()" method
$output = $obj->SayHello();
echo $output.' this text in PHP
'; // Displays (so this comes from the class!)
// Call the "SayNumber()" method
$output = $obj->SayNumber();
// Displays (so this comes from the class!)
echo $output.' is a lucky number';
//Because the JVM caches everything we want reset while
playing with the code. Otherwise the
// a cached version of the same class file will be used
rather than the new one
echo "
Resetting back-end to initial state\n";
// suppress the warning message from the use of reset.
@java_reset();
?>
That's it. Now browse to the PHP page and you should get
the results shown below.
----
Server IP: 59.162.86.8
Probable Submitter: 119.82.96.18
----
Manual Page -- http://www.php.net/manual/en/java.examples-basic.php
Edit -- https://master.php.net/note/edit/91455
Del: integrated -- https://master.php.net/note/delete/91455/integrated
Del: useless -- https://master.php.net/note/delete/91455/useless
Del: bad code -- https://master.php.net/note/delete/91455/bad+code
Del: spam -- https://master.php.net/note/delete/91455/spam
Del: non-english -- https://master.php.net/note/delete/91455/non-english
Del: in docs -- https://master.php.net/note/delete/91455/in+docs
Del: other reasons-- https://master.php.net/note/delete/91455
Reject -- https://master.php.net/note/reject/91455
Search -- https://master.php.net/manage/user-notes.php