Jump to content

IsArray question


Recommended Posts

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...

Link to comment
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]) )

Edited by SolidSnake
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...