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

  • SEARCH
  • Home
  • 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 814743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:34:14+00:00 2026-05-15T01:34:14+00:00

I am trying to create a loop statement for some of my code and

  • 0

I am trying to create a loop statement for some of my code and am wondering how I can put a variable within another variable.

For example:

<?php 
$j=1;
while ($j <= 9): {

$f$jfname = $_SESSION['F$jFirstName'];
$f$jmi = $_SESSION['F$jMI'];
$f$jlname = $_SESSION['F$jLastName'];
}
 $j++; endwhile; 
?>

Where the goal is to have the j variable increase during the loop and change the values as:

$f1fname $f2fname $f3fname

and so on.

Any ideas?

EDIT

Yes I am aware that my INITIAL form was flawed in the way I captured information (as individual variables as opposed to arrays) so any answer telling me that SESSION is an array and so on is irrelevant because I cannot call any variables implicitly from the SESSION variables I created (without a line by line reference) All variable stored in SESSION are completely unique and independent of each other.

  • 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-15T01:34:15+00:00Added an answer on May 15, 2026 at 1:34 am

    Didn’t test the code myself but perhaps something like:

    <?php 
    $names = array();
    for ($j=1; $j <= 9; $j++) {
       if (! isset($names[$j]))
         $names[$j] = array();
       $names[$j]['fname'] = $_SESSION["F{$j}FirstName"];
       $names[$j]['mi'] = $_SESSION["F{$j}MI"];
       $names[$j]['lname'] = $_SESSION["F{$j}LastName"];
    }
    ?>
    

    Then you have an array with arrays of the userinfo

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

Sidebar

Ask A Question

Stats

  • Questions 500k
  • Answers 501k
  • 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 You can use git format-patch to create a sequence of… May 16, 2026 at 2:07 pm
  • Editorial Team
    Editorial Team added an answer by starting your application using python manage.py runserver 192.168.1.1:8000 replace… May 16, 2026 at 2:07 pm
  • Editorial Team
    Editorial Team added an answer In your document ready handler, you can examine the value… May 16, 2026 at 2:07 pm

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 am trying to create a intersection statement using a foreach loop for example
I'm doing some refactoring work on PHP/MySQL code and stumbled across an interesting problem,
I am trying to generate an NSDictonary that can be used to populate a
As an exercise, I'm trying to create a input stream manipulator that will suck
Here is my dilemma and thank you in advance! I am trying to create
I am trying, and failing, to create a list of labels and text boxes
What I am trying to do is load in objects from an XML save
I have a php calendar at http://idea-palette.com/aleventcal/calendar.php . I want the days that are
What I am trying to do is save a Move objects into a Vector
I'm trying to write a function in PL/PgSQL that have to work with a

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.