Re: Passing the Array as Parameter to either the function or object/class???

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2004-10-21 at 09:57 -0400, Scott Fletcher wrote:
> Hi!
> 
>     I wanted to know is can it be done by passing the array as a parameter
> to the function?
> 
>     I also wanted to know is is it possible to pass around the array in the
> object-orientated feature like object/class stuffs?
> 

yes and yes.

ie:

function foo($bar)
{
  print_r($bar);
}

$myarray = array(1,2,3,4);

foo($myarray);

ouputs:

Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [3] => 4
)


cheers,

Robby

-- 
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | robby@xxxxxxxxxxxxxxx
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
****************************************/

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux