Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Learning PHP

Learning PHP

Scheduled Pinned Locked Moved The Lounge
learningcsharpjavascriptphp
31 Posts 21 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AspDotNetDev
    wrote on last edited by
    #1

    Now that I have a NOOK, I decided to learn a new programming language on a whim. For some reason, PHP was the first thing that came to mind. I downloaded an ebook, "I Hate PHP: A Beginner's Guide to PHP and MySQL", which is the most terrible book I've ever spent money on. Makes sense, since it was like $4. I still haven't installed an IDE (though I downloaded NetBeans), but from what I've read I'd say PHP is like a server side version of JavaScript and whatever "language" you use with the command prompt. It appears that variables are not strongly typed and the use of strings in variables is weird (if the crappy ebook I bought is to be trusted):

    $str1 = "hello";
    $str2 = "world";
    echo "$str1 $str2";
    // This is a comment.

    And this is a comment too? WTF.

    Feels dirty to use variables in a string like that and have them be not be treated as literals. Kinda nifty though. In any event, I'm happy I'm learning PHP. It will give me something to hate much more than VB.NET. :rolleyes:

    [WikiLeaks Cablegate Cables]

    J OriginalGriffO B L K 12 Replies Last reply
    0
    • A AspDotNetDev

      Now that I have a NOOK, I decided to learn a new programming language on a whim. For some reason, PHP was the first thing that came to mind. I downloaded an ebook, "I Hate PHP: A Beginner's Guide to PHP and MySQL", which is the most terrible book I've ever spent money on. Makes sense, since it was like $4. I still haven't installed an IDE (though I downloaded NetBeans), but from what I've read I'd say PHP is like a server side version of JavaScript and whatever "language" you use with the command prompt. It appears that variables are not strongly typed and the use of strings in variables is weird (if the crappy ebook I bought is to be trusted):

      $str1 = "hello";
      $str2 = "world";
      echo "$str1 $str2";
      // This is a comment.

      And this is a comment too? WTF.

      Feels dirty to use variables in a string like that and have them be not be treated as literals. Kinda nifty though. In any event, I'm happy I'm learning PHP. It will give me something to hate much more than VB.NET. :rolleyes:

      [WikiLeaks Cablegate Cables]

      J Offline
      J Offline
      Joan M
      wrote on last edited by
      #2

      Wait until you discover global variables! :sigh:

      [www.tamelectromecanica.com] Robots, CNC and PLC machines for grinding and polishing.

      M 1 Reply Last reply
      0
      • A AspDotNetDev

        Now that I have a NOOK, I decided to learn a new programming language on a whim. For some reason, PHP was the first thing that came to mind. I downloaded an ebook, "I Hate PHP: A Beginner's Guide to PHP and MySQL", which is the most terrible book I've ever spent money on. Makes sense, since it was like $4. I still haven't installed an IDE (though I downloaded NetBeans), but from what I've read I'd say PHP is like a server side version of JavaScript and whatever "language" you use with the command prompt. It appears that variables are not strongly typed and the use of strings in variables is weird (if the crappy ebook I bought is to be trusted):

        $str1 = "hello";
        $str2 = "world";
        echo "$str1 $str2";
        // This is a comment.

        And this is a comment too? WTF.

        Feels dirty to use variables in a string like that and have them be not be treated as literals. Kinda nifty though. In any event, I'm happy I'm learning PHP. It will give me something to hate much more than VB.NET. :rolleyes:

        [WikiLeaks Cablegate Cables]

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #3

        I've never really wanted to learn PHP: every time I look at a "code" sample, I am reminded of GWBasic, shudder, and look away again, quickly...

        Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        A T 2 Replies Last reply
        0
        • A AspDotNetDev

          Now that I have a NOOK, I decided to learn a new programming language on a whim. For some reason, PHP was the first thing that came to mind. I downloaded an ebook, "I Hate PHP: A Beginner's Guide to PHP and MySQL", which is the most terrible book I've ever spent money on. Makes sense, since it was like $4. I still haven't installed an IDE (though I downloaded NetBeans), but from what I've read I'd say PHP is like a server side version of JavaScript and whatever "language" you use with the command prompt. It appears that variables are not strongly typed and the use of strings in variables is weird (if the crappy ebook I bought is to be trusted):

          $str1 = "hello";
          $str2 = "world";
          echo "$str1 $str2";
          // This is a comment.

          And this is a comment too? WTF.

          Feels dirty to use variables in a string like that and have them be not be treated as literals. Kinda nifty though. In any event, I'm happy I'm learning PHP. It will give me something to hate much more than VB.NET. :rolleyes:

          [WikiLeaks Cablegate Cables]

          B Offline
          B Offline
          Brady Kelly
          wrote on last edited by
          #4

          AspDotNetDev wrote:

          In any event, I'm happy I'm learning PHP. It will give me something to hate much more than VB.NET. :rolleyes:

          Hello Comrade! :) I too am learning PHP. I accepted some work on some PHP based sites last week, with the client being aware PHP is not one of my skills, but that I can get by. It's proving interesting. :wtf:

          1 Reply Last reply
          0
          • A AspDotNetDev

            Now that I have a NOOK, I decided to learn a new programming language on a whim. For some reason, PHP was the first thing that came to mind. I downloaded an ebook, "I Hate PHP: A Beginner's Guide to PHP and MySQL", which is the most terrible book I've ever spent money on. Makes sense, since it was like $4. I still haven't installed an IDE (though I downloaded NetBeans), but from what I've read I'd say PHP is like a server side version of JavaScript and whatever "language" you use with the command prompt. It appears that variables are not strongly typed and the use of strings in variables is weird (if the crappy ebook I bought is to be trusted):

            $str1 = "hello";
            $str2 = "world";
            echo "$str1 $str2";
            // This is a comment.

            And this is a comment too? WTF.

            Feels dirty to use variables in a string like that and have them be not be treated as literals. Kinda nifty though. In any event, I'm happy I'm learning PHP. It will give me something to hate much more than VB.NET. :rolleyes:

            [WikiLeaks Cablegate Cables]

            L Offline
            L Offline
            leonej_dt
            wrote on last edited by
            #5

            I began learning PHP this January. It is an ugly language, which totally makes sense because it was never actually designed. But it helps me get things done faster than C++ (my favorite language), .NET or (God forbid!) Java, so I guess I cannot complain. IMHO, the best PHP IDE is Notepad++. Yes, it is not actually an IDE. Script languages are not suited to IDEs. And, actually, JavaScript is a nice language. I basically love its logical operators. Unless your users use Internet Explorer, in which case JavaScript is basically the spawn of the devil. --- EDIT: Oh, and also, the best way to use in-string variables is the following:

            echo "{$str1} {$str2}";
            echo "{$obj->member1} {$obj->member2}";

            Notepad++ will even nicely highlight {$var} and {$obj->var} with a different color than the rest of the string.

            Eduardo León

            L 1 Reply Last reply
            0
            • A AspDotNetDev

              Now that I have a NOOK, I decided to learn a new programming language on a whim. For some reason, PHP was the first thing that came to mind. I downloaded an ebook, "I Hate PHP: A Beginner's Guide to PHP and MySQL", which is the most terrible book I've ever spent money on. Makes sense, since it was like $4. I still haven't installed an IDE (though I downloaded NetBeans), but from what I've read I'd say PHP is like a server side version of JavaScript and whatever "language" you use with the command prompt. It appears that variables are not strongly typed and the use of strings in variables is weird (if the crappy ebook I bought is to be trusted):

              $str1 = "hello";
              $str2 = "world";
              echo "$str1 $str2";
              // This is a comment.

              And this is a comment too? WTF.

              Feels dirty to use variables in a string like that and have them be not be treated as literals. Kinda nifty though. In any event, I'm happy I'm learning PHP. It will give me something to hate much more than VB.NET. :rolleyes:

              [WikiLeaks Cablegate Cables]

              K Offline
              K Offline
              Keith Barrow
              wrote on last edited by
              #6

              There are lots of languages out there like that, I've yet to meet one that wasn't evil. I wrote a PHP website for some friends, their budget was tiny, so I got free hosting (lots for PHP). I needed a good long shower after I finished, but there is a spot of dirt on my hand I can't quite get rid of.

              Sort of a cross between Lawrence of Arabia and Dilbert.[^]
              -Or-
              A Dead ringer for Kate Winslett[^]

              L 1 Reply Last reply
              0
              • A AspDotNetDev

                Now that I have a NOOK, I decided to learn a new programming language on a whim. For some reason, PHP was the first thing that came to mind. I downloaded an ebook, "I Hate PHP: A Beginner's Guide to PHP and MySQL", which is the most terrible book I've ever spent money on. Makes sense, since it was like $4. I still haven't installed an IDE (though I downloaded NetBeans), but from what I've read I'd say PHP is like a server side version of JavaScript and whatever "language" you use with the command prompt. It appears that variables are not strongly typed and the use of strings in variables is weird (if the crappy ebook I bought is to be trusted):

                $str1 = "hello";
                $str2 = "world";
                echo "$str1 $str2";
                // This is a comment.

                And this is a comment too? WTF.

                Feels dirty to use variables in a string like that and have them be not be treated as literals. Kinda nifty though. In any event, I'm happy I'm learning PHP. It will give me something to hate much more than VB.NET. :rolleyes:

                [WikiLeaks Cablegate Cables]

                L Offline
                L Offline
                l a u r e n
                wrote on last edited by
                #7

                ultraedit or ultrastudio will do you well as an IDE for PHP PHP is a loosely typed language ... the strings in variables thing is because PHP has a greedy tokenizer that will see anything after a $ sign as a variable name ... if you put your strings in single quotes you get strings as you know them instead PHP is a far superior web scripting language, in my experience, to c# *depending* on what you are trying to achieve if you go into it with an open mind you might find it quite nice oh yeah.. since you are learning from scratch do yourself a favor and go get TinyButStrong (*very* odd name) ... a wicked good template engine that lets you have code behind files just like .NET and keeps things *much* tidier when you get larger projects hth :)

                "mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"

                A G L 3 Replies Last reply
                0
                • L leonej_dt

                  I began learning PHP this January. It is an ugly language, which totally makes sense because it was never actually designed. But it helps me get things done faster than C++ (my favorite language), .NET or (God forbid!) Java, so I guess I cannot complain. IMHO, the best PHP IDE is Notepad++. Yes, it is not actually an IDE. Script languages are not suited to IDEs. And, actually, JavaScript is a nice language. I basically love its logical operators. Unless your users use Internet Explorer, in which case JavaScript is basically the spawn of the devil. --- EDIT: Oh, and also, the best way to use in-string variables is the following:

                  echo "{$str1} {$str2}";
                  echo "{$obj->member1} {$obj->member2}";

                  Notepad++ will even nicely highlight {$var} and {$obj->var} with a different color than the rest of the string.

                  Eduardo León

                  L Offline
                  L Offline
                  l a u r e n
                  wrote on last edited by
                  #8

                  very good :)

                  "mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"

                  1 Reply Last reply
                  0
                  • K Keith Barrow

                    There are lots of languages out there like that, I've yet to meet one that wasn't evil. I wrote a PHP website for some friends, their budget was tiny, so I got free hosting (lots for PHP). I needed a good long shower after I finished, but there is a spot of dirt on my hand I can't quite get rid of.

                    Sort of a cross between Lawrence of Arabia and Dilbert.[^]
                    -Or-
                    A Dead ringer for Kate Winslett[^]

                    L Offline
                    L Offline
                    l a u r e n
                    wrote on last edited by
                    #9

                    funny... i feel the exact same way about .NET

                    "mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"

                    B 1 Reply Last reply
                    0
                    • L l a u r e n

                      funny... i feel the exact same way about .NET

                      "mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"

                      B Offline
                      B Offline
                      Brady Kelly
                      wrote on last edited by
                      #10

                      I love .NET, but recent PHP work is leaving me feeling quite dirty.

                      L 1 Reply Last reply
                      0
                      • A AspDotNetDev

                        Now that I have a NOOK, I decided to learn a new programming language on a whim. For some reason, PHP was the first thing that came to mind. I downloaded an ebook, "I Hate PHP: A Beginner's Guide to PHP and MySQL", which is the most terrible book I've ever spent money on. Makes sense, since it was like $4. I still haven't installed an IDE (though I downloaded NetBeans), but from what I've read I'd say PHP is like a server side version of JavaScript and whatever "language" you use with the command prompt. It appears that variables are not strongly typed and the use of strings in variables is weird (if the crappy ebook I bought is to be trusted):

                        $str1 = "hello";
                        $str2 = "world";
                        echo "$str1 $str2";
                        // This is a comment.

                        And this is a comment too? WTF.

                        Feels dirty to use variables in a string like that and have them be not be treated as literals. Kinda nifty though. In any event, I'm happy I'm learning PHP. It will give me something to hate much more than VB.NET. :rolleyes:

                        [WikiLeaks Cablegate Cables]

                        W Offline
                        W Offline
                        wout de zeeuw
                        wrote on last edited by
                        #11

                        I kinda liked the Zend IDE a couple of years back. Never head big problems with php, it's not really fit to build huge abstraction layers and such, but in a web browser you are already very limited in what you can do, and php nicely reflects that.

                        Wout

                        1 Reply Last reply
                        0
                        • B Brady Kelly

                          I love .NET, but recent PHP work is leaving me feeling quite dirty.

                          L Offline
                          L Offline
                          l a u r e n
                          wrote on last edited by
                          #12

                          shame

                          "mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"

                          1 Reply Last reply
                          0
                          • L l a u r e n

                            ultraedit or ultrastudio will do you well as an IDE for PHP PHP is a loosely typed language ... the strings in variables thing is because PHP has a greedy tokenizer that will see anything after a $ sign as a variable name ... if you put your strings in single quotes you get strings as you know them instead PHP is a far superior web scripting language, in my experience, to c# *depending* on what you are trying to achieve if you go into it with an open mind you might find it quite nice oh yeah.. since you are learning from scratch do yourself a favor and go get TinyButStrong (*very* odd name) ... a wicked good template engine that lets you have code behind files just like .NET and keeps things *much* tidier when you get larger projects hth :)

                            "mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"

                            A Offline
                            A Offline
                            Andy Brummer
                            wrote on last edited by
                            #13

                            l a u r e n wrote:

                            code behind files just like .NET

                            I hope it's not actually code behind files like .net, because those are pretty awful. Have you looked at MVC and Razor? I've only played around with it a little bit, but it seems nice. I think someone finally realized that java wasn't the target anymore, and needed something easy to use and learn to counter things like PHP and Ruby.

                            Curvature of the Mind now with 3D

                            L 1 Reply Last reply
                            0
                            • A Andy Brummer

                              l a u r e n wrote:

                              code behind files just like .NET

                              I hope it's not actually code behind files like .net, because those are pretty awful. Have you looked at MVC and Razor? I've only played around with it a little bit, but it seems nice. I think someone finally realized that java wasn't the target anymore, and needed something easy to use and learn to counter things like PHP and Ruby.

                              Curvature of the Mind now with 3D

                              L Offline
                              L Offline
                              l a u r e n
                              wrote on last edited by
                              #14

                              not it isn't code behind in the same sense as .NET but it gives a seperation of presentation and code in the same way ... i used code behind as a familiar term for a .NET dev to get the basic idea :)

                              "mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"

                              1 Reply Last reply
                              0
                              • A AspDotNetDev

                                Now that I have a NOOK, I decided to learn a new programming language on a whim. For some reason, PHP was the first thing that came to mind. I downloaded an ebook, "I Hate PHP: A Beginner's Guide to PHP and MySQL", which is the most terrible book I've ever spent money on. Makes sense, since it was like $4. I still haven't installed an IDE (though I downloaded NetBeans), but from what I've read I'd say PHP is like a server side version of JavaScript and whatever "language" you use with the command prompt. It appears that variables are not strongly typed and the use of strings in variables is weird (if the crappy ebook I bought is to be trusted):

                                $str1 = "hello";
                                $str2 = "world";
                                echo "$str1 $str2";
                                // This is a comment.

                                And this is a comment too? WTF.

                                Feels dirty to use variables in a string like that and have them be not be treated as literals. Kinda nifty though. In any event, I'm happy I'm learning PHP. It will give me something to hate much more than VB.NET. :rolleyes:

                                [WikiLeaks Cablegate Cables]

                                N Offline
                                N Offline
                                Nemanja Trifunovic
                                wrote on last edited by
                                #15

                                AspDotNetDev wrote:

                                I decided to learn a new programming language on a whim. For some reason, PHP was the first thing that came to mind.

                                Seriously, why? It won't improve your career - PHP jobs are less paid and more outsourced than .NET ones. It will not expand your horizons and make you a better programmer either. If you are into new "web languages", better look at Ruby.

                                utf8-cpp

                                A F 2 Replies Last reply
                                0
                                • A AspDotNetDev

                                  Now that I have a NOOK, I decided to learn a new programming language on a whim. For some reason, PHP was the first thing that came to mind. I downloaded an ebook, "I Hate PHP: A Beginner's Guide to PHP and MySQL", which is the most terrible book I've ever spent money on. Makes sense, since it was like $4. I still haven't installed an IDE (though I downloaded NetBeans), but from what I've read I'd say PHP is like a server side version of JavaScript and whatever "language" you use with the command prompt. It appears that variables are not strongly typed and the use of strings in variables is weird (if the crappy ebook I bought is to be trusted):

                                  $str1 = "hello";
                                  $str2 = "world";
                                  echo "$str1 $str2";
                                  // This is a comment.

                                  And this is a comment too? WTF.

                                  Feels dirty to use variables in a string like that and have them be not be treated as literals. Kinda nifty though. In any event, I'm happy I'm learning PHP. It will give me something to hate much more than VB.NET. :rolleyes:

                                  [WikiLeaks Cablegate Cables]

                                  M Offline
                                  M Offline
                                  M dHatter
                                  wrote on last edited by
                                  #16

                                  It is good to broaden your scope into other languages and scripting. The more you know the better work you will get. Also some people may say php is not in use or payed very well, it is completely a lie, hell look at facebook uses it, then compiles it down to c. With your strings above just remember to always use them the following way. $str1 = 'hello'; $str2 = 'world'; echo "$str1 $str2"; Single quotes do not invoke variable replacing and are a lot faster. Also something kool is when you get into replacing ids in arrays.

                                  "I do not know with what weapons World War 3 will be fought, but World War 4 will be fought with sticks and stones." Einstein "Few things are harder to put up with than the annoyance of a good example." Mark Twain

                                  1 Reply Last reply
                                  0
                                  • N Nemanja Trifunovic

                                    AspDotNetDev wrote:

                                    I decided to learn a new programming language on a whim. For some reason, PHP was the first thing that came to mind.

                                    Seriously, why? It won't improve your career - PHP jobs are less paid and more outsourced than .NET ones. It will not expand your horizons and make you a better programmer either. If you are into new "web languages", better look at Ruby.

                                    utf8-cpp

                                    A Offline
                                    A Offline
                                    AspDotNetDev
                                    wrote on last edited by
                                    #17

                                    Nemanja Trifunovic wrote:

                                    why? It won't improve your career

                                    It's a new skill (and I love learning), and it may help me do things that I couldn't do before. For example, MediaWiki plugins are written in PHP, so I can now create plugins for the most popular wiki software in the world. That would have been useful at my last company, as we had an installation of MediaWiki we all used.

                                    [WikiLeaks Cablegate Cables]

                                    1 Reply Last reply
                                    0
                                    • OriginalGriffO OriginalGriff

                                      I've never really wanted to learn PHP: every time I look at a "code" sample, I am reminded of GWBasic, shudder, and look away again, quickly...

                                      Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

                                      A Offline
                                      A Offline
                                      AspDotNetDev
                                      wrote on last edited by
                                      #18

                                      I learned programming with QuickBasic, so any reminder of that time would be both nostalgic and horrific. :)

                                      [WikiLeaks Cablegate Cables]

                                      1 Reply Last reply
                                      0
                                      • L l a u r e n

                                        ultraedit or ultrastudio will do you well as an IDE for PHP PHP is a loosely typed language ... the strings in variables thing is because PHP has a greedy tokenizer that will see anything after a $ sign as a variable name ... if you put your strings in single quotes you get strings as you know them instead PHP is a far superior web scripting language, in my experience, to c# *depending* on what you are trying to achieve if you go into it with an open mind you might find it quite nice oh yeah.. since you are learning from scratch do yourself a favor and go get TinyButStrong (*very* odd name) ... a wicked good template engine that lets you have code behind files just like .NET and keeps things *much* tidier when you get larger projects hth :)

                                        "mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"

                                        G Offline
                                        G Offline
                                        GStrad
                                        wrote on last edited by
                                        #19

                                        +1 For UE as an editor...

                                        1 Reply Last reply
                                        0
                                        • J Joan M

                                          Wait until you discover global variables! :sigh:

                                          [www.tamelectromecanica.com] Robots, CNC and PLC machines for grinding and polishing.

                                          M Offline
                                          M Offline
                                          MacRaider4
                                          wrote on last edited by
                                          #20

                                          I just used my first reference variable in a calendar I was working on, and it works... I'm not sure why it works because from everything I learned in C that variable shouldn't exist when I'm using it but for some reason it's still there. It's a bit messed up, but once you get the hang of it, it's not too bad. On a side note, IE seems to hate PHP as I can have a form looking great in Chrome, FireFox and Safari, look at it in IE 6 or 8 and the formatting is all over the place so good luck there as well... Did I mention I hate web programming (but it pays the bills) :laugh:

                                          L 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups