Sign in to follow this  
Followers 0
danpaul23

IsArray question

3 posts in this topic

I'm getting an array from a page with an uncertain number of elements. I want to check to see if a given Array and ellement exist before continuing.

The statement I'm trying but which does not give me a "true" in a "true" situation is:

If IsArray($aArray[0]) Then...

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

you are using IsArray incorrectly. what you could do is:

1.check if $aArray is an array (IsArray($aArray))

2.make sure $aArray[0] is contains the datatype you want (ie. for number do IsNumber($aArray[0]) )

Edited by SolidSnake

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

you are using IsArray incorrectly. what you could do is:

1.check if $aArray is an array (IsArray($aArray))

2.make sure $aArray[0] is contains the datatype you want (ie. for number do IsNumber($aArray[0]) )

Great, Thanks for the Help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0