Java in PHP
| From: | Idaham | Date: | Fri, 05 Jul 2002 06:38:10 +0000 |
| Subject: | Java in PHP | ||
| Groups: | php.qa php.windows | ||
| Request: | Send a blank email to php-qa+get-5598@lists.php.net to get a copy of this message | ||
Hi,
I'm really new to Java in PHP, and curious to this great features.
Q: How do I convert the code below so that it can run within PHP?
===============================================================
import com.my.sm.api.*;
import com.my.sm.api.interfaces.*;
public class my1
{
public static void main(String args[]) {
if (args.length != 3) {
System.err.println("Usage : java my1 <server> <username>
<password>");
return;
}
System.out.println("Starting Engine..");
String server = args[0];
String username = args[1];
String password = args[2];
ApiSession session = null;
try {
session = ApiSession.openSession(server, username, password);
} catch (RuntimeException e) {
System.out.println(e.getMessage());
return;
}
}
}
=====================================================
FYI, I'm using PHP 4.2.1 with Java extension and JDK1.3.
Thanks.
--idaham