Jump to content

Arrays and Multi-dimensionals


Go to solution Solved by DW1,

Recommended Posts

I take it that array's can't have a value that is non-numeric, correct?  If not then that is gonna lead to a slight problem with my next little script I want to do.  Basically something like this:

Global $aListing[72][2] = [[118, AUD], [123, BNK],

etc...  till I fill up all 72 segments.   Th point will be to compare the pc's ip address to the first portion of the array, then take the 2nd half of the array(the site id) and use it later in the script.  But I get a great big red Syntax Error.  The only other way I can think of doing it is to get the ip address, strip out the 2nd octet and use a metric crap-ton of if .. else statements to do what I want, but that it not efficient nor clean coding. Any other ideas?

Link to comment
Share on other sites

You need to "quote" your strings :)

 

Yeh, I just figured that out while waiting for a response. I'll do that and see what happens. Thanks

Edit:  Do I need to increase the 2nd portion of the array from 2 to something else?

Edit2: Nope I do not need to change the 2nd value of the array.

Edited by PDowning
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...