1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What is the best way to learn PHP?

Discussion in 'PHP' started by CaffinePhil, Feb 15, 2008.

  1. #1
    I have just got my head around HTML and the basics of CSS and I want to learn PHP, can anyone recommend tutorials/books/sites or even a method of learning? I have never done anything with programming before.

    Also do I need to have a domain with hosting to test out/write scripts?
     
    CaffinePhil, Feb 15, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    This is a common question, and has been answered numerous times. Not trying to be a bitch, but search the forums for "learning PHP".

    No, you can set up your local server. Install XAMPP:
    http://www.apachefriends.org/en/xampp.html
     
    nico_swd, Feb 15, 2008 IP
  3. Cobnut

    Cobnut Peon

    Messages:
    184
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ... or you could go the whole hog and install Apache/PHP/MySQL, it's really a lot easier than you might think, pretty much point and click.

    If you're going to be developing/building sites it's a good idea to get yourself an 'offline' development environment anyway.

    Jon
     
    Cobnut, Feb 15, 2008 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    That's exactly what XAMPP does. It's really easy to install and use.
     
    nico_swd, Feb 15, 2008 IP
  5. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #5
    Meh I could never really get how to do it (without an all-in-one pack). So I installed uniform server, and now I can't get PgSQL to work with it :( My knowledge has come a long way since then though, so I may try again sometime.
     
    blueparukia, Feb 15, 2008 IP
  6. Tim Rogers

    Tim Rogers Guest

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I suggest you took on the site Tizag. It walks you through things, from variables to conditions, in an easy to cope with way. Once you've done that, I suggest you download some relatively simple scripts and read through them any try to understand them, using PHP.net to look up functions you don't understand.
     
    Tim Rogers, Feb 15, 2008 IP
  7. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #7
    Yeah, Tizag is the best site I have found to learn. After you run through tTzag, look at the wider scope w3schools covers - more functions, though you already know the basics.
     
    blueparukia, Feb 15, 2008 IP
  8. cmircea

    cmircea Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I think the best way to learn PHP or any other language is to start developing small projects, and that way you will see how things work (forms, validations, databases, etc).
     
    cmircea, Feb 15, 2008 IP
  9. CaffinePhil

    CaffinePhil Banned

    Messages:
    945
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thank you all for your posts, nico_swd - apologies I will try and remember to search before posting in the future.

    So an install of apache, mysql and php and then i should be able to set up an "offline" development area?
     
    CaffinePhil, Feb 15, 2008 IP
  10. aaron_nimocks

    aaron_nimocks Im kind of a big deal Staff

    Messages:
    5,563
    Likes Received:
    627
    Best Answers:
    0
    Trophy Points:
    420
    #10
    Just install xampp that was mentioned in this thread already. After that then you can work locally on your computer.
     
    aaron_nimocks, Feb 15, 2008 IP
  11. walkere

    walkere Active Member

    Messages:
    112
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #11
    Yes. That'll set up a directory on your computer as an area that you can access through your browser and have the php processed.

    You could also get a free host with php support. When I first learned php, I worked on Frihost for about a year before I upgraded to a paid host. I don't think it's reliable enough for real development purposes, but it's great for small scale projects that you want to test out with your friends.

    As for learning, I'd suggest three things.

    Read Practical PHP Programming. It's a great free book for learning PHP.

    Frequent PHP forums (like DigitalPoint). If you opt to use Frihost as a free host, you'll need to stay somewhat active in their forums as well. Reading other people's problems and working out an answer to their questions is probably the best way to learn. You learn far better by teaching and doing than be reading.

    As a last resort, check the official php.net documentation. This is a huge resource, and it's great for getting the low-down on a specific function. IMO it's too big and disorganized to be a good learning source, tho, so use it as a reference to supplement the book and the forums.

    Good luck,
    - Walkere
     
    walkere, Feb 15, 2008 IP