Page 1 of 1

[SOLVED] Function of "=>"

Posted: Fri May 30, 2008 7:37 am
by Janco
Hi there,

Sorry to post a silly question like this but I've search then net and went through the PHP manual but I can't seem to find what the "=>" is used for, can anyone explain it to me?

Re: Function of "=>"

Posted: Fri May 30, 2008 8:29 am
by xitura
It is used to asign values to an array, example:

Code: Select all

//This
$array_1 = array('payment' => 150);
 
//Is the same as this
$array_2 = array();
$array_2['payment'] = 150;

Re: Function of "=>"

Posted: Fri May 30, 2008 8:35 am
by Janco
Thanks a mil Xitura!