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
Hey I have been battling with this problem for a while now. Perhaps there
I've been battling with this issue for a couple of days now. I have
I have been battling with this piece of code for literally days now... Would
I have been battling with this code for quite a while and just don't
I have been battling with this for a couple of days. I am trying
I've been battling with this issue for over 2 weeks now and have gotten
I've been battling this for a few hours now, and it may just be
I've been battling with this for a while, I'm not familiar with PHP syntax,
I've been battling PHP's email reading functions for the better part of two days.

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.