TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   function that returns an array -- why not working? (http://www.talkphp.com/absolute-beginners/3237-function-returns-array-why-not-working.html)

Dave 08-13-2008 03:48 PM

function that returns an array -- why not working?
 
My code (kinda lengthy) for this function is working, and goes something like this:
PHP Code:

function (udf_whatnot)
{
   
$array = array()

   For (
1 to $n)
   {
      Do 
a calculation;
      
array_push($arrayetc.) ;
   }
   
// (The array is now complete and checks out OK.)
   
return $array ;


But...the array is NOT returned as expected! What erroneous assumption(s) am I making??

I checked out the documentation, but to no avail.

Thanks,
Dave

Enfernikus 08-13-2008 04:07 PM

We can handle lengthy code, post it?

Karl 08-13-2008 04:35 PM

Yes, post the actual code.

Dave 08-13-2008 05:01 PM

Thanks for your responses.

I did post the code, but I just removed it because I know a big part of the problem. It was just a little thing: A COMPLETE MISUNDERSTANDING OF FUNCTIONS AND ARRAYS!! That's all.


All times are GMT. The time now is 03:52 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0