1

Possible Duplicate:
What to do after learning basic PHP?
How to increase my “advanced” knowledge of PHP further? (quickly)

Hi,

I started learning PHP about this time last month and i now know how to create websites using basic php. I would like to further my knowledge but i dont know which way to turn.

I've heard of frameworks like codeigniter, zend, cakePHP but dont know what use they are for. Should they be my next step? Im currently using NetBeans.

I look at other php scripts and how their directly structure is tidy and sorted into folders whereas all my files are on the root level. How do i learn to create a script structure correctly?

I would also like to learn how to use templates, do the frameworks help with this?

Also, I learned Java at college. So should OO PHP be my next step?

Basically, what is the road map for going from a beginner to master?

Community
  • 1
  • 1
Jonathan
  • 3,016
  • 9
  • 43
  • 74
  • Duplicate: [How to increase my “advanced” knowledge of PHP further? (quickly)](http://stackoverflow.com/questions/2948323/how-to-increase-my-advanced-knowledge-of-php-further-quickly), [What to do after learning basic PHP?](http://stackoverflow.com/questions/3487276/what-to-do-after-learning-basic-php) – gnovice Sep 21 '10 at 13:36

11 Answers11

6

I would say, take it this way:

  1. Learn PHP basics (you did that step)
  2. Learn Object Oriented PHP
  3. Get familiar with design patterns
  4. Learn to use frameworks

A lot of "side-knowledge" is required to get experienced, like getting used with PHP extensions and common libraries. Do not read only, get your hands wet and make sure you code a lot to get your experience. Keep asking questions and let others review your code.

Books/references i recommend:

user228395
  • 1,156
  • 1
  • 11
  • 25
5

I suggest reading a good book or two. Those will give you a lot more insight and knowledge than probably any resource you can find on the Web.

For example A Step-By-Step Guide to Creating Dynamic Websites and PHP and MySQL Web Development.

Saul
  • 17,973
  • 8
  • 64
  • 88
3

Basically it is just work as much as you can. 4-8 hours a day for 2-10 years, and I'm not kidding :)

Here is a really short list for becoming a good php-programmer;

  1. Teach yourself object oriented programming
  2. Disipline yourself to organize your code in libraries and put them in directories
  3. Read about "Don't repeat yourself" and "Convention over configuration" on wikipedia
  4. Teach yourself Ruby (and/or Python) (yes, really), and use what you learn.
  5. Read about Design Patterns
  6. Google for phpdoc and phpcs and start using those tools.
  7. When you are finished with a piece of code write it again using what you've learned
  8. Follow the tutorials of some of the PHP Frameworks out there.
  9. Follow the tutorials for Doctrine when starting with a database centered project.
  10. Write enormous amounts of code, and wait several years before being satisfied with something you've written.
thomasmalt
  • 1,718
  • 11
  • 15
2

PHP is becoming more and more OO as it progresses, so that would definitely be a good next step if you have the basics down.

Learn some entity frameworks (or maybe put one together on your own) for interacting with databases and using PHP objects to represent table data.

Also, you can look into some PHP MVC Frameworks, as MVC is becoming very popular now with its "east to test" mindset and its logic separation.

Scott
  • 2,143
  • 2
  • 19
  • 25
2

Forget all about OOP and Zend and the big boys.

What i think you should do is research cross language similarities, now this may not be the exact term but ill explain what I mean.

All languages have resemblances but deal with them differently, Such as:

  • Type casting
  • Logical Statements
  • Conditions
  • Bitwise operators
  • etc..

Now when I talk about Type Casting I am talking about being able to change data types such as Array > Object, In PHP this can be achieved simply like (object)$array but you need to fully understand what exactly its doing and where would you need to perform this kind of task.

Now in regards to things like Logical Statements im not just talking about an IF statement here and there, make sure you understand exactly what's happening and what expressions are what, take these examples:

  • if($a = $b)
  • if($a == $b)
  • if($a === $b)
  • if($a !== $b)
  • if($a != $b)
  • if($a < $b)
  • if($a > $b)
  • if($a <> $b)
  • if($a >= $b) .. And so on

Do you know them all.

Once you are confident in these programming entities then you can proceed to the next level, not just creating a class and using it, but being able to understand how to get the best out of OOP :)

Your programming style at the moment is what we call procedural programming, its basically writing in the way you think, in your mind you think you want to echo something at that point in your application then so you Just echo 'a string'; but as you get more into depth about things you will start to learn things like how HTTP works, and you have to learn that you cant always just send content half way threw your APP, as its error prone and so forth.

By understanding the above fully when you go into the more complex architectures / methods such as OOP, MVC, ORM etc you would be more equipped so to speak, and you will not just be a script kiddie, not personal..

Also do the folling before you touch a PHP Script again.

  • Go buy a chalk board, must be black.
  • Set it up in a well lit environment
  • Make sure you have a white chalk
  • Write on the board 100 times

I will read a book and study, no matter how hard it seems, I will read at least 1 book

Hope this helps you out sir succeed

RobertPitt
  • 56,863
  • 21
  • 114
  • 161
  • I would add if($a <> $b) to conditions. – Richard Knop Sep 21 '10 at 13:20
  • Forget about that one :) done. – RobertPitt Sep 21 '10 at 13:24
  • 2
    This answer feels somewhat condescending to me. It's probably the part about operators and the chalkboard. I was at this phase once, even after being very experienced in other languages and knowing everything in this post including OOP. I just wasn't familiar with how PHP was done "properly" - if there is such a thing. Basically I think you're making too strong an assumption about his overall programming ability. – Tesserex Sep 21 '10 at 13:46
  • Thats fair enough, If my assumptions was incorrect that there is a down vote for this action, but as i was reading his initial post thats the feeling i got, so i typed in a way i thought would be the best, mmost of the other answers are simply saying, go for OOP without thinking about the smaller things. theres no rush to learn. – RobertPitt Sep 21 '10 at 14:02
  • I didnt want to talk about myself that much but if you want to know i have a software development degree where i studied algorithms and java (SE upto servlets/jsp) for three years. i just dont know how to do PHP properly. – Jonathan Sep 21 '10 at 14:09
2

Create something simple that you can use. I'm a sysadmin and will forever be a sysadmin but I picked up PHP when things slow down at work. I found a need for a helpdesk system at work, so I started coding it from scratch. I found examples of how to do different things online and just picked it apart and used it in my code. The key is repetition, keep coding and you'll get better at it. You'll make mistakes and you'll get frustrated, but after a while it just comes naturally to you.

sdot257
  • 10,046
  • 26
  • 88
  • 122
2

It would be nice to know what you have already studied, but here is what I did when I learnt PHP :

  • Language basics (variables, conditions, loops, functions, etc)
  • Object-oriented PHP (classes, inheritance, ...) : In the beginning it could be a little bit confusing but you will soon realize that it helps a lot in keeping the code organized
  • Object relational mapping (doctrine, ...)
  • Some reading about design patterns (especially MVC) will help you to understand things better
  • Use the previous skills to correctly organize your projects structure
  • Some reading about HTTP could always be useful
  • Try the PHPDoc to correctly document your code
  • Object Oriented PHP Framework : plenty of choice, just try and choose your favorite one (I went for Zend, but CakePHP seems interesting now)

For each step do a simple project to apply what you learnt, it's the best way to improve. I think that jumping directly to a framework is a bad thing and could be confusing. I would at least experiment with the Object Oriented PHP first.

Another great thing would be to experiment other languages like Python or Java. My Java knowledge prevented me to do bad things in PHP and helped to understand the OO programming.

And finally, post questions on Stackoverflow if you have problems :)

Marc Demierre
  • 1,088
  • 13
  • 24
  • thanks for your answer :) well i spent 3 years in college studying algorithms and java (from SE up to servlets/jsp) so php basics were pretty easy to pick up. Only thing was to understand how to create an actual website. I done that and now i've made a exchange system for a local community but the code is just with basic php so i would like to keep improving it. – Jonathan Sep 21 '10 at 13:28
  • 1
    Then you should try objects. As you already know Java, it won't be difficult and it will help to better organize your code. After that, moving to a framework will save you a lot of work for future projects and teach you good practices. Something else that is not mentioned by many people but is very important is the documentation. Even if code is well-written, without documentation it is really hard to maintain. The PHPDoc is similar to Javadoc, and it is a great product. – Marc Demierre Sep 21 '10 at 13:41
2

PHP is great language and has a lot of stuff to learn, i recommend you to:

I hope these tips will help you to learn more about php.

Skatox
  • 4,237
  • 12
  • 42
  • 47
1

I agree with comments before me. Only one addition about a book which was a great help for me when started to work with php: Advanced PHP Programming from George Schlossnagle

It teaches you about coding styles, design patterns best practices...

Daniel Lenkes
  • 306
  • 2
  • 8
0

Learn PEAR and PECL extensions, they are distributed components written in PHP. Contribute to opensource projects, like Drupal or codeignitor etc.

Ibrahim
  • 1,247
  • 3
  • 13
  • 21
  • Good suggestions they may be, but they're all a long way further down the line than the next step the questioner is looking for. – Spudley Sep 21 '10 at 13:20
0

I bought the two Sitepoint books about learning OOP PHP. Couple of years old now, but the reference in them is amazing, and you get a massive pull-out chart with regular expressions and common functions, whcih always sits behind me at my desk :-)

Alex
  • 7,320
  • 1
  • 18
  • 31