Jump to content
Sign in to follow this  
danpaul23

IsArray question

Recommended Posts

danpaul23

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
FuryCell

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
danpaul23

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.