0

How to get the same PHP functions in Java? Is there any .jar available for such?

  • Just for an example what I mean was like this (pure Javascript doing PHP behaviors): http://phpjs.org/

Thanks in advance.

10
  • As far as I know, no. But I must admit it's an interesting concept for people that do both PHP and Java, like myself (sometimes). Commented Apr 4, 2011 at 8:53
  • 3
    Mark - I believe it's java, he did say "jar"... Commented Apr 4, 2011 at 8:54
  • 4
    java is not php, php is not java. There are many things between both languages, that are not comparable at all. Learn java instead of hacking around with language library ports. Commented Apr 4, 2011 at 8:57
  • 2
    Would you like generics with that? Commented Apr 4, 2011 at 8:58
  • 1
    @Mark he explecitly said "PHP function in JAVA" ;-) Commented Apr 4, 2011 at 9:08

1 Answer 1

1

I think what you search is quercus. It's a java implementation of PHP. But i doubt that it is somehow efficient to run php code in java.

Also there are some translationframeworks that translate PHP code into Java. I once read of one but don't remember the name.

But the best way to do java is by doing java ;-)

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you but, i am really looking for something in Java, and i want to import Php functions in a class file or .jar so that i can use them simply like Php p = new Php(); p.base64_encode(bla); p.base64_decode(bla); p.md5(bla); p.json_encode(bla); p.json_decode(bla);
Or better yet, several static methods on a com.php class. So you can just call com.php.base64_encode(blah). Surely someone somewhere has created these

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.