Search found 3 matches

by mrl72
Tue Jan 08, 2008 7:31 pm
Forum: PHP - Code
Topic: Using [] in function call
Replies: 5
Views: 649

feyd | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] eh.. just...
by mrl72
Tue Jan 08, 2008 6:53 pm
Forum: PHP - Code
Topic: Using [] in function call
Replies: 5
Views: 649

Ah yes I see. I looked in the function and I can see it returning an array.

return array( $var1, $var2, $var3) etc.

So I could use:

$var = myfunction($var1, $var2, $var3);

$var0 = $var[0];
$var1 = $var[1];
$var2 = $var[3];

Something like that?
by mrl72
Tue Jan 08, 2008 6:14 pm
Forum: PHP - Code
Topic: Using [] in function call
Replies: 5
Views: 649

Using [] in function call

Hi - I'm beginning learning PHP so apolgoize if this is a really dumb question. I am looking at some code and see a line as follows: $var = myfunction($var1, $var2, $var3)[1]; I don't understand what the [1] at the end of the line is for? Also, this is throwing a parse error unexpected '['. Any help...