On Wed, 16 May 2001, Dennis Gearon wrote:

> I want to pass in a scalar int, or an array of ints (indices) to a
> function in a class. The scalar or array will be a class variable.
>
> Without knowing the max size of each index, or the number of indices,
> (as is required is most other languages), I can't figure out how to
> access the array in a flexible fashion.  What I **WANT** to use as a
> clue is whether the passed $index value is a scalar, or how many
> elements are in the array.
>
> examples:
>
> function work_on_array( $value, $index ){
>   blah to $this->value_s_holder;
>    ..
>    ..
> }
>
> work_on_array( 7, array(4,5) );
> work_on_array( 23, 1 );
>
> The number of INDICES will not change during program execution, although
> I do not want to have to predict the range of the scalar/indices.
>
> any ideas?

I am having trouble parsing this question.

Are you simply asking if there is away to check whether the $index
parameter is a scalar or an array?  If so, see php.net/gettype

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to