$array = array('name' => 'John', 'age' => 29); $obj = JArrayHelper::toObject($array); echo $obj->name; // Outputs 'John'This code converts the associative array to an object using the JArrayHelper::toObject function. The resulting object can then be accessed using object notation rather than array notation. Based on the naming convention of the library, it is likely that this is part of the Joomla framework/library.