If you had a database class that contained functions to do with a database (I'm not going to write it).
Your class is $db.
1 function is clean() to sanitise inputs for databases.
1 function is insert() to insert inputs into the database.
1 function is select() to select from the database.
Now, because these are contained in the $db class, we can access these functions as a child property of that class, by using the (->) operator.
$db->clean($_POST['somestuff']);
$db->insert($_POST['somestuff']);
I'm sorry if that didn't help, as Attilitus said it's used to access methods and variables that are stored inside your class.
|