FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » What is the purpose of "&" in this code?
Show: Today's Messages :: Unread Messages :: Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
What is the purpose of "&" in this code? [message #186110] Sat, 14 June 2014 11:08 Go to next message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
foreach($master as &$ma)
$tmp[] = &$ma["date"];
array_multisort($tmp, $master);
foreach($master as &$ma)
echo $ma["date"]."<br/>";
Message by Christoph Michael Bec is ignored  [reveal message]  [reveal all messages by Christoph Michael Bec]  [stop ignoring this user] Go to previous messageGo to next message
Re: What is the purpose of "&" in this code? [message #186112 is a reply to message #186110] Sat, 14 June 2014 14:32 Go to previous messageGo to next message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On 6/14/2014 11:08 AM, richard wrote:
>
> foreach($master as &$ma)
> $tmp[] = &$ma["date"];
> array_multisort($tmp, $master);
> foreach($master as &$ma)
> echo $ma["date"]."<br/>";
>

http://www.php.net/manual/en/language.references.pass.php
Re: What is the purpose of "&" in this code? [message #186115 is a reply to message #186110] Sat, 14 June 2014 16:04 Go to previous messageGo to next message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
remove from buddy list
ignore all messages by this user
On Sat, 14 Jun 2014 11:08:48 -0400, richard wrote:

> [code]

Either (a) ask the person who wrote the code, or (b) read the manual
yourself.

--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
Re: What is the purpose of "&" in this code? [message #186116 is a reply to message #186110] Sat, 14 June 2014 21:25 Go to previous message
Doug Miller is currently offline  Doug Miller
Messages: 171
Registered: August 2011
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
richard <noreply(at)example(dot)com> wrote in news:tvhj7dle16f3$(dot)ro2c41zfpmyn(dot)dlg(at)40tude(dot)net:

>
> foreach($master as &$ma)
> $tmp[] = &$ma["date"];
> array_multisort($tmp, $master);
> foreach($master as &$ma)
> echo $ma["date"]."<br/>";
>

RTFM, RtS.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: function for preserving special characters?
Next Topic: How to loop through the dates?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Oct 03 10:12:55 EDT 2024

Total time taken to generate the page: 0.05693 seconds