PDA

View Full Version : What is ->, => and how are they used?


Mhtml
05-14-2003, 11:34 AM
As above.

For example in this code:
$ADMIN->done_screen( count($ids)." Members Approved", "Manage Registrations", "act=mem&code=mod" );and$ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code' , 'do_add_rank' ),
2 => array( 'act' , 'mem' ),
) );

Are they like using . in OOP?

Weirdan
05-14-2003, 12:04 PM
-> is a 'member selection operator'.

$object->member;

So you're almost right, it's like . in VB ;). OOP by itself does not define any operators, it's just a methodology. Each object oriented language then define its own operators (-> for example, it is used in C++ too).

=> in the definition of an array is a separator between key and value. So, if the array is defined as follows:

$my_array = array('apple' =>'green', 'cherry'=>'red','orange'=>'orange')


and you do use it like this:

$color=$my_array['cherry'];

variable $color would hold "red"

Mhtml
05-15-2003, 02:46 AM
Ahhh, okey dokey then. :) Thankyou! :thumbsup: