[SOLVED] Function of "=>"

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Janco
Forum Commoner
Posts: 37
Joined: Fri Apr 25, 2008 2:51 am

[SOLVED] Function of "=>"

Post 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?
Last edited by Janco on Fri May 30, 2008 8:35 am, edited 1 time in total.
xitura
Forum Newbie
Posts: 20
Joined: Fri Sep 07, 2007 11:25 am

Re: Function of "=>"

Post 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;
Janco
Forum Commoner
Posts: 37
Joined: Fri Apr 25, 2008 2:51 am

Re: Function of "=>"

Post by Janco »

Thanks a mil Xitura!
Post Reply