Click to See Complete Forum and Search --> : [RESOLVED] -> syntax


rogerl_uk
09-13-2005, 04:06 PM
Hi I'm a newbie and have been given this line of code as prt of a code snippet.

$file=$db->fetch_array($result);

However, I am confused by the -> between the variable $db and fetch_array() function

What is the meaning of ->

thorpe
09-13-2005, 04:33 PM
$db is an object (not a variable), and fetch_array() is a method belonging to the $db object. the -> is used to reference methods of objects.

there are some basic tutorials on the use of objects here (http://www.php.net/manual/en/language.oop.php) in the manual.