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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:35:09+00:00 2026-06-05T21:35:09+00:00

When I dump my the varable var_dump($search_results_returned[‘post_q_2_full’]); the following is printed: array(1) { [0]=>

  • 0

When I dump my the varable

var_dump($search_results_returned['post_q_2_full']);

the following is printed:

  array(1) { 
          [0]=> array(7) {
                     ["user_id"]=> string(2) "15" 
                     ["user_name"]=> string(12) "Steve Smith" 
                     ["user_username"]=> string(8) "sjcallan" 
                     ["user_image_filename"]=> string(16) "xhewimg_15.jpeg"     
                     ["user_first_name"]=> string(5) "Steve"
                     ["user_last_name"]=> string(6) "Smith" 
                     ["user_email"]=> string(18) "ssmith@gmail.com" 
          }
    } 

When I am trying

foreach ($post_q_2_full as $post2) { // line 48

echo $post2['user_first_name'];
}

I am getting the following error:

Message: Undefined variable: post_q_2_full

Filename: _account/search.php

Line Number: 48

And the following error message is thrown at my face as well:

Message: Invalid argument supplied for foreach()

Filename: _account/search.php

Line Number: 48

I will appreciate any eventual help.

Regards, Zoran

  • 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-05T21:35:11+00:00Added an answer on June 5, 2026 at 9:35 pm

    You are trying to do a foreach loop on a variable that does not exist.
    post_q_2_full is the key inside $search_results_returned variable, and not a variable on it’s own.

    So what you’re looking for is this:

     <?php
     foreach ($search_results_returned['post_q_2_full'] as $post2) { // line 48
        echo $post2['user_first_name'];
     }
    

    Note:
    IMHO the variable name is too long, so I would try to shorten that in the actual production code.

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

Sidebar

Related Questions

var_dump('<a>') // or var_dump(<a>) // or var_dump(\x3Ca>) // all result in string(3) What is
I need to dump all data from the object into two-dimetional array this is
When I var_dump on a variable called $tags (a multidimensional array) I get this:
Somehow a variable that SHOULD contain only one string (not an array or anything)
I defined a variable called $thumbs_number. I did var_dump : string(52) 2 and print_r
In PHP, I get a dump of all variables like so: var_dump(get_defined_vars()); However, in
When I dump the details of a local variable using the dt command in
Cannot dump Stack Overflow XML file into SQL Server 2008. Could you please explain
How can I dump all the global variables and the address offsets in my
I try to dump my data thought php script but without command line. SO

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.