newb question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • fatbeaver

    newb question

    hi guys, i just started learning php, and am qurious what the arrow
    sign operator mean..
    for ex:

    $this->dbConnect();


    can someone explain it to me?


    thanks.

  • Rik

    #2
    Re: newb question

    fatbeaver wrote:[color=blue]
    > hi guys, i just started learning php, and am qurious what the arrow
    > sign operator mean..
    > for ex:
    >
    > $this->dbConnect();
    >
    >
    > can someone explain it to me?[/color]

    In short:
    It calls a method or variable from an object.
    Reading material:
    PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.



    Grtz,
    --
    Rik Wasmus


    Comment

    • Edmond Dantes

      #3
      Re: newb question

      fatbeaver wrote:
      [color=blue]
      > hi guys, i just started learning php, and am qurious what the arrow
      > sign operator mean..
      > for ex:
      >
      > $this->dbConnect();
      >
      >
      > can someone explain it to me?
      >
      >
      > thanks.[/color]

      You must really be new to programming in general.

      The "->" notation is used to reference a method or a variable off of an
      object. It's all about Object-Oriented Programming.

      There are many good books and references on the subject of OOP. I suggest
      you avail yourself of them.

      --
      -- Edmond Dantes, CMC
      And Now for something Completely Different:


      Choose a memorable domain name. Professional, friendly customer support. Start using your domain right away.







      Posted Via Usenet.com Premium Usenet Newsgroup Services
      ----------------------------------------------------------
      ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
      ----------------------------------------------------------
      Best Usenet Service Providers 2025 ranked by Newsgroup Access Newsservers, Usenet Search, Features & Free Trial. Add VPN for privacy.

      Comment

      • Treefrog

        #4
        Re: newb question

        fatbeaver wrote:[color=blue]
        > hi guys, i just started learning php, and am qurious what the arrow
        > sign operator mean..
        > for ex:
        >
        > $this->dbConnect();
        >
        >
        > can someone explain it to me?[/color]

        Ignore it. Learn PHP first, then worry about that one.

        It's a whole different way of programming, but unless you know the
        language very well in the first place, it will just make things more
        confusing.

        However, to satisfy the question the -> is referring to a method or
        member of a class.

        Basically; You can code in objects, which is in very simple terms,
        where everything is like a real life object.

        e.g. imagine a person object. A person has a name, age, hair colour
        etc, so if you had written a person "class" you would use it in you
        code with the -> operator. Like...

        $someChap = new person(); // set the variable $someChap to be a person
        object.

        $someChap->name = "Bob";

        Anyway, as I said, learn PHP properly first, then worry about all this
        stuff. It will make you a better programmer, in my opinion.

        Good luck and enjoy it.

        Nathan

        Comment

        Working...