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 885391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:54:17+00:00 2026-05-15T12:54:17+00:00

I have a function which must return one dimensional associate array, like $user_info[$index]=value where

  • 0

I have a function which must return one dimensional associate array, like $user_info[$index]=value where $index is a string which consist of

  • user_id
  • full_name
  • photo_file_name

for example, my associative array could look like $user_info['user-123456789~~Bill Gates~~bill_gates.png']=$value. I need user_id, full_name and photo for another needs, in order to know whose value is this and what is his full name, etc.
So, the questions that has risen are following:

  1. Is it OK to have such an array if to take into account performance of the application?
  2. If it is bad (I think that it is bad idea) so how can I solve my problem in this case.

Additional info. This function retrieves user information into this associative array and returns this array. Further, my application stores it in a session in order to address it and retrieve information right from the session variable, not execute once again a query. And finally the reason I need one dimensional array is that I use a function array_diff where one of the arrays are $user_info array.
Note, Take into account that one user could have 1 or many values.

Any suggestions would be pleased.

  • 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-05-15T12:54:18+00:00Added an answer on May 15, 2026 at 12:54 pm

    You have a long key in an associative array.

    I don’t think it’s a problem. If you wanted to shorten it you could hash your key-value and store the value with the hashed value.

    That being said, have you asked yourself why you’re using that schema? Might it be better to come up with a different data structure to suit your needs?

    I’d be much more concerned with the amount of data (size of the array) that you’re storing in the session variable. I think using the session to store data like this is a bad idea.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 541k
  • Answers 541k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Argh... I found the reason. I shouldn't save the context… May 17, 2026 at 2:48 am
  • Editorial Team
    Editorial Team added an answer Yes it's built in. You don't have to do it… May 17, 2026 at 2:48 am
  • Editorial Team
    Editorial Team added an answer It sounds like adding the above code prevents your Form… May 17, 2026 at 2:48 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a class which must return a CGRect from one of its methods:
I have several stored procedures which return a strongly typed result set. I've learned
Let's say I have to implement a piece of T-SQL code that must return
if i have somthing like that: func (x1:x2:x3:xs) = xs then x1,x2,x3 must exist,
I have a table with several fields and one field having 3 Comma Separated
I am using a 3rd party library function which reads a set of keywords
I would like to apply some function on each row of a dataframe in
This is one of those situations where I've had to pick up and run
I'm trying to replicate CI's humanize() and underscore() function in Javascript. From the CI
we've got a problem with one of our non dpi aware MFC applications. If

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.