Returning arrays from a function in PHP
Posted: Thu Mar 25, 2004 7:06 am
Dear All
If I have a function return_strings($itemID), can I make it return an array of values? For example, could I do this -
$string1 = return_strings(5)[1];
$string2 = return_strings(5)[2];
$string3 = return_strings(5)[3];
It doesn't seem intuitively that this would be the case - in which case, is there any other way of doing this?
Many thanks
Mark
If I have a function return_strings($itemID), can I make it return an array of values? For example, could I do this -
$string1 = return_strings(5)[1];
$string2 = return_strings(5)[2];
$string3 = return_strings(5)[3];
It doesn't seem intuitively that this would be the case - in which case, is there any other way of doing this?
Many thanks
Mark