|  | Posted by Rik on 01/18/07 12:34 
Erwin Moller wrote:> Hi,
 >
 > Consider the following code:
 >
 > -------------------------
 > function giveArr(){
 >   return array("one","two","three");
 > }
 >
 > echo giveArr()[1];
 > // I am hoping for "two"
 > -------------------------
 >
 > This syntax clearly doesn't work.
 > Does anybody know if that is possible?
 > If so, what is the right syntax?
 
 Not really. There are some options related to it, like the list()
 construct.
 Also, for this particular case one might use vprintf('%2$s',giveArr());
 --
 Rik Wasmus
  Navigation: [Reply to this message] |