Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 341
  • Last Modified:

Getting Ready for a PHP position.

I've got an interview with an IT firm for a PHP/Java position.

I want to be ready.

What areas of PHP should I be fluent in? How can I prepare? I'm an intermediate with PHP.

0
weikelbob
Asked:
weikelbob
  • 10
  • 8
  • 5
  • +3
5 Solutions
 
John KawakamiCommented:
Probably learn how to call Java from PHP.
0
 
weikelbobAuthor Commented:
That's a good idea.

What else?

I'd like to know the areas of PHP which are most usually expected for a PHP programming job.
0
 
babuno5Commented:
check this url it has a good set of php questions
http://www.sitepoint.com/forums/showthread.php?t=439118
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
TeRReFCommented:
- PHP/ Database interaction
- String manipulation
- Optimilazation of code
- IF they're using PHP5 especially, OOP
- Code seperation (using template egines like Smarty (smarty.php.net))

TO name a few :)
0
 
weikelbobAuthor Commented:
What string manipulation aspects do I need to know?

Also, should I open a separate question for each area I need to talk to you guys about?
0
 
TeRReFCommented:
Well, string manipulation is one of the strengths of PHP. THere are loads of functions (as you know) that can make life easy for you. It's just a matter of combining those functions in a proper way.
It's not a matter of knowing all the ins and outs of every string function, what params they require etc. It's more a matter of knowing what function you could use for a certain task. (the phpdocs will provide you with the ins and outs at all times :)

So, knowing how to use the phpdocs is vital to being an inventive programmer.

Asking what string manipulation aspect you need to know is a very hard question to answer. It's better to read through the phpdocs on the matter:
http://php.net/strings

You're already an intermediate PHP programmer, so you've been working with string for quite some time. You will know what kind of string manipulation you use most of the times. It won't be much different in a different working environment.

I can give you some pointers though:
- Don't use regex unless necessary. I find that a lot of people use it for very simple tasks that could do with i.e. str_replace().
- Make sure you do skill yourself provoundly in regex though, since they're vital for more complicated string manipulation
- Don't get stuck on an idea, if you can't solve a problem with the string functions you're using, distance yourself from the it for a while and think of other methods to solve the problem (but that goes for all programming problems I guess :) This might sound like advice that everyone knows already, but I had to learn it...

Good luck,
TeRReF
0
 
weikelbobAuthor Commented:
TeRReF,

Thank you. That synopsis is exactly what I was looking for.

Now what is optimization of code?  (Let me know if I should open a separate question.)

0
 
TeRReFCommented:
Well, there's always good and bad approaches to problems. Ones that take a lot of time and or resources and ones that don't.
I realize that sometimes it's more work to do things the 'right' way, especially when under time pressure. But ALWAYS keep opmimization in the back of your head when developping.
To give you some examples:
Using file_get_contents() instead of fopen(), fread()/fgets() and fclose() is easier. It will be a good method if the file is small, but when you work with huge files it means that the whole file has to be loaded into memory. When you use fopen(), etc. this will not happen and you will be able to handle the file 1 line at a time...

Another example is DB result sets. Same story, a lot of people and the whole resultset to an array first and then start to process it. A better way (usually) is to retrieve the resultset 1 row at a time and process it in the same loop...

These are just pointers and you will have to analyze every situation on it's own since they're all different. Saying these sorts of things during the interview, will help you a lot though. It will make them realize you are aware.

So, during the interview it's not all about knowledge about the language aspects, equally important is how you use it...
0
 
TeRReFCommented:
Oh, another important part of optimization is query performance.
0
 
weikelbobAuthor Commented:
"IF they're using PHP5 especially, OOP"

What are you referring to here?
0
 
TeRReFCommented:
In PHP5, Object Oriented Programming capabilities matured (more or less). In other words, since then it's possible to do some serious OOP programming in PHP. As soon as it was available, I started to use it since it makes reusability of code easier.
0
 
weikelbobAuthor Commented:
OK.

So how do you create a class in PHP5?  (Only a brief answer is needed)
0
 
AmigoJackCommented:
please... that last question doesnt make you sound so intermediate.
http://www.php.net/manual/en/language.oop5.php
0
 
TeRReFCommented:
<?php

        class blah {
                public $member;
                //other members (vars)

                function __construct($var) {
                      $this->member = $var
                }

                 // other methods that define the class' functionality
        }

         $object = new blah('value');

?>
0
 
John KawakamiCommented:
I suggest that you don't even bother trying to fool the interviewer.  Just fess up to how much PHP you know.  If you know Java well, it won't be a big issue -- they'll probably assume you can be taught.
0
 
weikelbobAuthor Commented:
You're right jk2001,

I don't want to fool them.

I'm seeing that there is a lot of PHP I don't know.

Perhaps to finish this off, you guys could give me some links to advanced tutorials.

Bob

0
 
John KawakamiCommented:
I learned a lot of PHP by downloading canned scripts and reading the code.  A lot of it wasn't that good, though.  Managing a codebase for some project is a great way to get good, very fast.  If you know someone who needs a CMS-backed website, maybe you can volunteer to install and configure the system, and add a few features.

The PHP.net site has a lot of good examples, too.  Look at the comments.
0
 
weikelbobAuthor Commented:
"I learned a lot of PHP by downloading canned scripts and reading the code. "

Good idea. Do you have some direction or links as to where to come across the right scripts?

0
 
John KawakamiCommented:
Here are the ones I've studied, with a few star ranks indicating code quality/interesting-ness:

HORDE/IMP **** (out of 5)
Drupal ***
PhpMyAdmin ****
PHPMailer **

That's the open source stuff.  I've also used HiveMail, vBulletin, aeDating, GUSTMail.  They vary in quality, too.  I usually look for stuff at hotscripts.com and freshmeat.net.  Also, there is a lot of code at PHPClasses.com, php.net, and in the PEAR repository.

Most established scripts are written for PHP4, while most of the new frameworks rely on PHP5.
0
 
AmigoJackCommented:
sidenote: thx jk2001 for hotscripts.com - from that i found a wonderful WYSIWYG editor for free which works on MSIE, OPER and FIRE :) thx alot
0
 
TeRReFCommented:
@AmigoJack
Can you share the URL for that editor with us? :)
0
 
AmigoJackCommented:
@TeRReF: http://www.openwebware.com/products/openwysiwyg/
its a very good enhancement (i.e.) for a html-allowed phpBB. users without knowledge of html can nearly work with it like they know it from ms word - and skilled users can always toggle between html- and text-view. of course, this one is also not a perfect one, but the best solution ive seen so far (which also cares for all major browsers)
0
 
TeRReFCommented:
@AmigoJack
Thanks! Looks very good.
0
 
weikelbobAuthor Commented:
jk2001,

Can you give me a link to specific pieces of, for example, HORDE/IMP code? it's a big project and I'm not sure where to start.

0
 
John KawakamiCommented:
Yes, all those are big projects.   Here's the URL for horde.

http://www.horde.org/imp/

For smaller scripts, I suggest hotscripts.  Some of those require payment to deploy, but you can still look at the code to learn things.
0
 
ellandrdCommented:
to learn OO PHP, check this site out:

http://phpbee.com/examples/object_oriented_php/

hope this helps and good luck with the job!

ellandrd
0
 
weikelbobAuthor Commented:
ellandrd,

Thanks! I just spent 5 minutes in that link and I've already learned a lot.

Question: When do you use OO PHP in a project?
0
 
ellandrdCommented:
yes its a good site isnt it.  i first came across this site a few months ago while searching for a PHP script and i noticed your question in the list of open questions and thought - i know the perfect PHP website...  im glad its helping you learn more and prepare better for interview!

>>When do you use OO PHP in a project?

Very good question Bob! Well I suppose the whole point of OOP is to think in terms of objects - real things.  This
means nouns which have a state/data and verbs which cause them to perform actions.

GUI programming is one place where OO is handy and obvious.  Having a
Window class which draws itself makes alot sense.  A list of windows which your
program owns is then quite simple.

Here are 2 nice discussions related to OOP that will help you understand more:

When to use and when not to use OOP
(http://www.sitepoint.com/forums/showthread.php?t=182925&page=1)

Maximize PHP apps using OOP techniques
(http://builder.com.com/5100-6371-5054846.html)

Good Luck
Ellandrd
0
 
weikelbobAuthor Commented:
Thanks everyone,

Bob
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 10
  • 8
  • 5
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now