hosted by liquidweb

Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : If I know a little bit of Java, does that make PHP

Forum Jump

If I know a little bit of Java, does that make PHP

Reply Post New Thread In Programming Discussion Subscription
Send news tip View All Posts Thread Tools Search this Thread Display Modes
Web Hosting Guru
Join Date: Jul 2002
Posts: 314

If I know a little bit of Java, does that make PHP

easier to learn? Can I learn at least the basics of PHP in 3 weeks with some Java knowledge?

Sponsored Links
Web Hosting Master
Join Date: Nov 2003
Posts: 682
I have heard that PHP is somewhat similar to Java. If you already have some knowledge of programmaing concepts, I think you could pick up basic PHP in 3 weeks. Granted, you won't have much experience with debugging it and such, you could learn the basic functions (strings, loops, etc).

Web Hosting Guru
Join Date: Jul 2002
Posts: 314
Are strings, loops, etc. in PHP similar to Java? In comparison, isn't PHP easier to learn than Java or no?

Sponsored Links
Web Hosting Master
Join Date: May 2001
Location: Montreal, Quebec
Posts: 589
The PHP syntax is very similar to Java and C. However, Java is 100$ object oriented while PHP can do OO and strutural. But overall, PHP is a very easy language to learn.

WHT Addict
Join Date: Sep 2003
Posts: 131
Java is a programming language and PHP is a scripting language. Java has a much higher learning curve than PHP. Anyone with any previous knowledge of logic, etc., could probably pickup PHP in a few days, it really isn't very tough.

PHP *does* have some OO functions built into it, but it's nowhere near complete and just kind of a bad patch. (Thinking of <=v4 here, havenít read anything about 5 just yet.)

If you're thinking of the offline capabilities of it, once again I'll go with the limited functions deal. (Shouldn't take you too long to learn if you can program Java.)

Web Hosting Master
Join Date: Nov 2003
Posts: 682
PHP5 added a lot for object oriented coding. I don't know how strings and loops work in Java, so I couldn't answer that question. Head over to and check out the manual.

Join Date: Jul 2004
Posts: 22
Well if you're looking for a quicklist:

- Loop Constructs are identical (including foreach)
- Selection is identical (if / else / switch etc)
- String Handling is similar:

  //Java Init
    String mystring = "foo";
  // Java Append
     mystring = mystring + "bar";
  // PHP Init
      $mystring = "foo";
   // PHP Append
      $mystring = $mystring . "bar";
The main differences come with the Object Oriented side of things. You're constantly reminded of the fact you're programming in a OO language with Java. In PHP you have to be really careful how you structure your code, but it is very possible to get a OO feel to it (in particularly with PHP5).

Another thing to bear in mind is that PHP is "loosly" typed. For example:

  $myinteger = 1 + 3;
   echo ($myinteger); // will output 4;

  $mystring = "1" . "3";
  echo ($mystring); // will output 13
So you don't need to use a datatype when initialising a variable in PHP.

Hope that helps.

- Kar

Junior Guru Wannabe
Join Date: Jul 2002
Posts: 53
Hi Kit,

I have a Java->PHP translator project. Perhaps you might want to try this out. It's at

If you have any questions, please feel free to contact me.

BTW, if you're solid with any programming, you can probably start writing decent PHP code in 3 hours (just get a good IDE, so you can see what the built-in functions do; I recommend Zend's IDE).


Related posts from
Title Type Date Posted
Jelastic Releases Mobile App for Cloud Management Web Hosting News 2013-09-30 14:02:52
PHP Creator Rasmus Lerdorf Joins Jelastic as Advisor Web Hosting News 2013-07-05 13:06:00
Jelastic Launches Version 1.9.1 of Java and PHP Hosting Platform Web Hosting News 2013-05-21 09:39:09
Jelastic Integrates Java and PHP Cloud Platform with NetBeans IDE Web Hosting News 2013-05-06 13:34:29
Jelastic Partners with innofield to Launch Beta Service in Switzerland Web Hosting News 2014-05-01 08:22:27

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Log in with your username and password

Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Web Hosting News:
WHT Membership
WHT Membership



Welcome to

Create your username to jump into the discussion! is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.

(4 digit year)

Already a member?