SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Zealot karnetics's Avatar
    Join Date
    Dec 2004
    Location
    USA
    Posts
    179
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question What is the best way to learn php

    I have been using php language for about 6 months now. I most say it is the easiest programming language to learn. My problem is that I can not figure out the best way to learn php.

    My question is, especially the advance php users. What was the best way you learned php and how long?
    1. Online tutorials
    2. Books
    3. self projects
    4. just happened

  2. #2

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The order for me

    • self projects / just happened
    • something
    • something more
    • even more of something
    • Online tutorials


    The only book about PHP I ever bought was the birthday present for a friend

  3. #3
    SitePoint Wizard swdev's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    1,053
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For me, it was practice, practice, practice, reading the manual then reading many posts in the SitePoint forums.

  4. #4
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Read lots of tutorials + do lots of coding, and then it just happens. Reading about overall programming concepts that can be applied to moreless all modern languages is the best thing as it will make you develop your programming technique, and you learn skills that apply to other languages. Look at design patterns a bit, make sure you understand good OO. remember that when writing a program that design patterns come naturally as you refactor code.

    If you don't have basic Unix knowledge, knowing stuff about that and Apache also helps a bit

  5. #5

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MiiJaySung
    If you don't have basic Unix knowledge, knowing stuff about that and Apache also helps a bit
    In case you want to use this combination

  6. #6
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Raleigh, NC
    Posts
    783
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    - online tutorials. until you are into advanced stuff (1-3 years from now) don't waste money on php books. everything you need is online.

    - coding is a skill, not a knowledge. you will not learn it from reading, you will learn it from repeatedly doing. find tutorials on sitepoint, devshed, etc and type out everything they do. get your hands in the habit of typing the language. in learning anything, repetition and practice are your friend.

    - as you learn little bits, apply them to something that interests you. have a pet project. constantly improve how you do things and learn how to apply new tricks to your project.

    - learn how to fix past bad coding decisions instead of redoing things from scratch.

    - ask questions in this forum. bonus: if you show that you put forth the first effort in trying to educate yourself before asking, everyone here will be more than happy to lend a hand. also, you'll learn how to solve future problems better if people aren't handfeeding you every answer.

  7. #7
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by karnetics
    I have been using php language for about 6 months now. I most say it is the easiest programming language to learn. My problem is that I can not figure out the best way to learn php.
    What is your current level? How much other programming have you done? If you are into the OO stage, what is your current understanding/skill at: writing OO code, designing OO systems, refactoring, testing, patterns?

    Could you post some sample code or describe a sample design. I know it is embarrasing to post stuff when you are just starting, but it would really help me diagnose just those pieces of the jigsaw you benefit from the most.

    I could give you a lot more pointers if I new where you were at now.

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  8. #8
    SitePoint Wizard Darren884's Avatar
    Join Date
    Aug 2003
    Location
    Southern California, United States
    Posts
    1,616
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi I suggest some books because alot of online tutorials dont clean their code well.
    Have a good day.

  9. #9
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Reading about overall programming concepts that can be applied to moreless all modern languages is the best thing as it will make you develop your programming technique, and you learn skills that apply to other languages.
    This point I think, to me anyways, is important. I don't think though that you should buy a book(s) until you've done some (considered) research into the subject, such as Design Patterns for one example?

    Read up on the subject first, then by all means buy the book(s) for desktop references, but that's my personal approach I might add

  10. #10
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Darren884
    Hi I suggest some books because alot of online tutorials dont clean their code well.
    I wouldn't always say that. Plenty of books have their fair share of errors (however they are normally checked more for silly security issues etc).

    I've only brought one computer boomk in my life. It's a Linux hand book which I rarely use and is probably quite outdated in places. If I need a book, I'll go to the library and find some books there (even so I rarely get round to reading them). Probably the best thing is to go to a university library. Lots of computer books at normal libraries to me are aimed at the "how to use mice for dummies" audience.

  11. #11
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It probably depends a bit on your learning style. I actually like to read, and will pick up a few books every other month or so. There are a number of threads around here on the subject, and I have picked up a number of very good books based on recomendations in this forum.

    When I was first learning I would go to the book store and flip through some of the books. If I found a tip in it that looks like it would save me time, I would buy it. I figure if I save myself two hours of time working out a problem because of a book I purchase, it is easily worth a $30-$50 dollar price tag. That analysis may be slightly biased because
    a) I read books on my own time
    b) I program on both my own time and on work time
    c) I usually have work pick up the tab for technical books

    php|architect is a very good resource. I have found the articles to be written by knowledgable professionals, and very valuable, expecially in areas where I have little familiarity. You should try the free trial issue, and review some of the free sample articles.

    Look at the sticky thread from Harry about Advanced PHP Resources at the top of this forum. That is a treasure trove of great resources, and in particular is probably a good filter for finding some of the higher quality tutorials which are available on the web.

    There is nothing like doing. As others have recommended, start some small project and DO it. When I wanted to learn MVC, I picked a small task that needed doing here at work, picked popular MVC framework and banged on it until I understood the concepts.

    Ask questions here and in the PHP forum. If you don't understand, ask questions about the answers you get. There are an incredible number of knowlegable members here who hang out and distribute valuable advice. I am not quite sure how it works, but I am very thankful that it does
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  12. #12
    simple tester McGruff's Avatar
    Join Date
    Sep 2003
    Location
    Glasgow
    Posts
    1,690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    Read up on the subject first, then by all means buy the book(s))
    I really, really wish you would stop posting here unless you have something intelligent to say. Aren't there chatrooms somewhere where you can hang out?

    Anyway, back on topic, I think you can go so far teaching yourself with various free resources including forums such as this but there are three often-recommended books which you must have:

    Design Patterns (GoF)
    Patterns of Enterprise Application Architecture (Martin Fowler)
    Refactoring (Martin Fowler)

  13. #13
    SitePoint Zealot karnetics's Avatar
    Join Date
    Dec 2004
    Location
    USA
    Posts
    179
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I aggree with you Darchangel, I have had better success repeating code and trouble shooting code that I have created that may have given me problems. Buy thinking about what you stated. I went and look at a piece of script that I had tried to right a while back and kept getting error messages. The script was to be an file upload script, uploading a mp3 file into a folder. Let me show you.

    My original script
    <?php
    /**This could would upload a mp3 file from a form**/
    //Set upload destination folder locally to the upload folder on c: drive
    $uploaddir = 'c:\www\demo\admin\upload\';
    //Set upload file
    $upload_file = $_FILES['file']['name'];
    move_uploaded_file($_FILES['file']['tmp_name'], $uploaddir);
    //end script
    ?>

    I had so many error with this code. So I did what you said, troubleshoot it and this is what I got.
    <?php
    /**This could would upload a mp3 file from a form**/
    //Set upload destination folder locally to the upload folder on c: drive
    $uploaddir = 'C:\Program Files\EasyPHP1-7\www\demo\upload/';
    //Set upload file
    $upload_file = $uploaddir . $_FILES['file']['name'];
    $uploadtype = $_FILES['file']['type'] == "audio/mpeg";
    if ($uploadtype == "audio/mpeg") {
    copy($_FILES['file']['tmp_name'], $upload_file) or die ("can not copy file");
    } else {
    echo "Invalid file type";
    }
    ?>
    and what do you know it worked.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •