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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:19:17+00:00 2026-05-19T03:19:17+00:00

Been battling with this one for what seems, like forever. I have an array:

  • 0

Been battling with this one for what seems, like forever.

I have an array:

$url_array

It contains this info:

Array ( 
   [ppp] => Array ( 
      [0] => stdClass Object ( 
         [id] => 46660 
         [entity_id] => 0 
         [redirect_url] => http://www.google.com 
         [type] => Image 
      ) 
      [1] => stdClass Object ( 
         [id] => 52662 
         [entity_id] => 0 
         [pixel_redirect_url] => http://www.yahoo.com 
         [type] => Image 
      ) 
      [2] => stdClass Object ( 
         [id] => 53877 
         [entity_id] => 0 
         [redirect_url] => http://www.msn.com 
         [pixel_type] => Image 
      ) 
   ) 
   [total_count] => 3 
)

I need to loop through it, and do things to each variable. I can get this to work:

foreach ($piggies_array as $key => $value) {
$id = $value[0]->id;
$redirect_url = $value[0]->redirect_url; }

Not unsurprisingly, it’s only echoing the first value of those variables, but no matter what I try I cannot get it to loop through:

$value->redirect_url;
$value=>redirect_url;

I would appreciate any help.

  • 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-19T03:19:17+00:00Added an answer on May 19, 2026 at 3:19 am

    This should do the trick:

    foreach ($url_array['ppp'] as $key => $object) {
        echo $object->redirect_url;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been battling this one for a while now. I have a stored proc
So I have been battling with this for some time and I need your
So I have been trying and battling with this for a few hours now.
I've been battling with this issue for a couple of days now. I have
So I have been battling this issue for awhile now and tried many different
Hi I have been battling with this issue all day. I have a vs2010
I have been battling like crazy with a javascript that allows for infinite scrolling
I've been battling with this bug for 3 hours. I have checked the build
I've been battling to get this right...basically I have the following HTML setup: <div
I have been battling this error with specjour for the past couple hours, and

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.