SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Learning PHP

  1. #1
    SitePoint Member
    Join Date
    May 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Learning PHP

    Hi everyone,

    I would like to ask you, what is the quickest way to learn php? Also how long do you think it would take for a newbie to gain the knowledge to develop a simple cms?


    Thanks

  2. #2
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1) buy a beginners book such as Sitepoint's Building Database Driven Websites and also learn to read the PHP documentation. When I say "learn to read" I'm not being condescending, there is a specific way function references are written which makes reading the documentation a lot more productive.

    For example have a look at the docs for the trim function.
    Code:
    string trim  ( string $str  [, string $charlist  ] )
    string (the first one) indicates that the returned value will be a string
    trim is the function name
    the (parenthesis) contain a list of arguments, or parameters that are passed to the function as variables
    $str is the first argument and the function expects it to be a string
    $charlist is an optional second argument, and should also be a string if supplied. You can tell it's optional because it's wrapped in square brackets

    So:
    PHP Code:
    echo trim();  //invalid. Missing required argument
    echo trim(array()); //invalid. argument is not a string
    echo trim(' I love breathing '); //valid. spaces at either end of string will be removed
    echo trim('To be continued....''.'); //valid. The full stops at the end of the string will be removed 

  3. #3
    SitePoint Addict Poiesis01's Avatar
    Join Date
    Jun 2007
    Location
    Cape Town
    Posts
    233
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good luck with learning PHP. I've started with w3schools.com and learnphp.org and beginner's books. It hasn't been quick for me

  4. #4
    SitePoint Member
    Join Date
    May 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @cranial-bore - thanks for the feedback, I already bought the book you mentioned I just need to dedicate lots of time and patience to it


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
  •