Topic awaiting preservation: What does -> and => in PHP mean? |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: Mpls, MN |
posted 12-22-2009 10:25
I've got a stupid PHP question, one I can't google because I have no idea what it's even called. code: while ($my_query->have_posts()) : $my_query->the_post();
|
Maniac (V) Inmate From: there...no..there..... |
posted 12-22-2009 16:00
the "->" is a pointer to an object or an object reference. |
Maniac (V) Inmate From: there...no..there..... |
posted 12-22-2009 16:03
also, there is a function "mysql_fetch_object" that is probably being used somewhere in there : |
Maniac (V) Mad Scientist From: Denver, CO, USA |
posted 12-22-2009 17:27
Also, "=>" is definitely for arrays. code: $fruits = array("apple", "pear", "orange");
code: echo $fuits[2];
code: $fruits = array(5=>"apple", "pear", "orange'");
code: $fruits = array("red"=>"apple", "green"=>"pear", "orange"=>"orange"); foreach($fruits as $color=>$fruit) { echo "$fruit is $color\n"; }
|
Paranoid (IV) Inmate From: Mpls, MN |
posted 12-22-2009 18:08
Thanks so much. Those were the last stumbling block to fully understanding what I was doing. |
Obsessive-Compulsive (I) Inmate From: ballarat, victoria, australia |
posted 05-09-2010 16:21
i have wondered what the => operator does for some time but never really had a need to use it makes sense now so thanks |
Obsessive-Compulsive (I) Inmate From: |
posted 09-20-2010 13:55
edit tp: spam removed |