PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 24th, 2002, 05:38 AM
sctajc sctajc is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 sctajc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 49 m 7 sec
Reputation Power: 0
return array ($array1, $array2, etc)

From a function I am trying to use the return statement and return four arrays. If I just try to return one array ie return array($array) all is ok. If I try adding another array ie return array($array1,$array2) I get the error message 'Fatal error: Unsupported operand types in /home/httpd/html/explorers.org.nz/html/report_graph.php on line 342'.

Is it possible to return from a function using array with more than one array in it or am I doing something wrong? One array with several non-arrays works ok (ie return array($array,$foo1,$foo2,$foo3).

Reply With Quote
  #2  
Old June 24th, 2002, 07:51 AM
EvilivE EvilivE is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Milwaukee, WI USA
Posts: 291 EvilivE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via Yahoo to EvilivE
RE: return array ($array1, $array2, etc)

Good question. I have never had to do that but I would try something like this:

return array(array($array1), array($array2));

Maybe ... maybe not.

Reply With Quote
  #3  
Old June 25th, 2002, 12:42 PM
CmdrDats CmdrDats is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: <br><img src='http://www.dats.co.za/icon.gif'>
Posts: 269 CmdrDats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to CmdrDats Send a message via AIM to CmdrDats Send a message via Yahoo to CmdrDats
RE: return array ($array1, $array2, etc)

yeah, it's certainly very possible..

perhaps try putting the array into a variable first before returning it..

your error seems to indicate that you're trying to use the returned array incorrectly.. show us some code?

Reply With Quote
  #4  
Old June 25th, 2002, 02:00 PM
sctajc sctajc is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 sctajc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 49 m 7 sec
Reputation Power: 0
RE: return array ($array1, $array2, etc)

You are right CmdrDats, I now have it working. I have $array4 with some incorrect data which was stuffing things up.

Thanks

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > return array ($array1, $array2, etc)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway