Help with ->

Discussion in 'PHP' started by Geloo, Jul 8, 2010.

  1. #1
    Hallo, I am a beginner my question is can somebody explain what -> this do and what is does in this code

    $this->link = mysql_connect($host, $user, $pass);
    mysql_select_db($db);
    register_shutdown_function(array(&$this, 'close'));
    
    Code (markup):


    thanks in advance.
     
    Geloo, Jul 8, 2010 IP
  2. Oxi

    Oxi Peon

    Messages:
    78
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    $this is used in Object oriented programming so in the case of this PHP code, $this->link is used to call the function named "link" from the current class.
    Take a look at the PHP documentation for classes and objects: http://php.net/manual/en/language.oop5.php
     
    Oxi, Jul 8, 2010 IP