Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8550717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:01:03+00:00 2026-06-11T14:01:03+00:00

I want to store some data in (I guess a semi-2, semi-3d array) in

  • 0

I want to store some data in (I guess a semi-2, semi-3d array) in PHP (5.3)
What I need to do is store data about each floor like this:

Floor    Num of Spots    Handicap          Motorcyle        Other
1         100            array(15,16,17)    array (47,62)   array (99,100)
2         100            array(15,16,17)    array (47,62)   array (99,100)
and on

The problem is, is if the Handicap+Motorcyle+Other were ints, I could just store the data in a 2d array. However, they aren’t. So I was thinking I could make something almost like a 3D array, with the first two columns only being in 2D.

The other thought I had was making a 2D array and for columns 3,4, and 5 instead of saving as

array(15,16)
//save like
1516

And then split at two digits (1 digit array numbers would be prefaced with a 0). However, I am wondering about the limit of the length of a string, because if I decide to move to a 3 digit length number in the array, like array(100, 104), and I need to store alot of numbers, I am thinking I am going to quickly exceed the max.

Edit 1
I like Omar’s answer alot, but I’m not sure as to how to pull the data out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:01:04+00:00Added an answer on June 11, 2026 at 2:01 pm

    While you could store them as ?D array, there is another approach you might want to consider :

    $stuff = array (
      'floor1' => 
      array (
        'NumSpots' => 100,
        'handicap' => array (15,16,17),    
        'motorcycle' => array (47, 62),
        'other' =>  array (99, 100),
        ),
      ),
      'floor2' => 
        'NumSpots' => 100,
        'handicap' => array (15,16,17),    
        'motorcycle' => array (47, 62),
        'other' => array (99, 100),
        ),
      )
    )
    

    That way, you can access things through mroe meaningful names like

    $stuff['floor1']['motorcycle'][2]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to store some data from structures like this: class Project { ChildA
I want to store some data during my site viewing. Sometime i need to
I store some data in MySQL and want to filter out rows that match
I want to temporary store some mapping data. The mapping is one to one.
I want to create a data store to allow me to store some data.
I want to store the average values of some data that is occasionally generated
Is this possible? Situation is that I want to store some XML in my
I'm trying to use $.data() for the first time. I want to store some
I want to use ADO.net to extract some data from an Excel file. This
I need to store some data in an ini file, and I have run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.