Jump to content

returning multiple arrays


stijn0713

Recommended Posts

I call a method and i want to return more then one value. this can be done in several ways, i've seen some like

 

$x = $a . "|" . $b . "|" . $c;

return $x;

 

and then using explode where you invoke the method.

 

This trick worked for me untill i wanted to return 3 arrays.

 

After exploding the arrays by |, i cannot use them anymore, e.g. i cannot f.e. print_r them. I will only display 'array'.

 

I guess this has something to do with call by reference / call by value.

 

Could somebody explain it more precisely ?

 

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/264491-returning-multiple-arrays/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.