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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:07:23+00:00 2026-06-11T07:07:23+00:00

Been looking around and am stumped. Basically I’m trying to filter out a result

  • 0

Been looking around and am stumped. Basically I’m trying to filter out a result from an xml feed and hide it from displaying in the html output. I’m trying to find out the venue “Hornblower Cruises and Events” and if it exists, hide the whole , which is the parent of all the nodes.

Here’s the URL: http://www.sandiegomagazine.com/goldstartest/rss3-exclude.php

Here’s my code:

<?php
 $myfeed = simplexml_load_file('https://www.goldstar.com/api/listings.xml?api_key=6d0d598c69dfecfcf028b0d2b3c9b693b606ad8c&postal_code=92101');
 $i = 0;
foreach ($myfeed as $goldstar): 
    $title=$goldstar->headline_as_html; 
    $summary=$goldstar->summary_as_html; 
    $dates=$goldstar->upcoming_dates->event_date->date; 
    $ourprice=$goldstar->our_price_range; 
    $fullprice=$goldstar->full_price_range; 
    $img=$goldstar->image; 
    $link=$goldstar->link; 
    $venue_name=$goldstar->venue->name;
    $venue_street=$goldstar->venue->address->street_address;
    $venue_locality=$goldstar->venue->address->locality;
    $venue_region=$goldstar->venue->address->region;
    $venue_zip=$goldstar->venue->address->postal_code;
    $venue_phone=$goldstar->venue->phone;
    $category=$goldstar->category_list->category->name;


   // if ($venue_name == 'Hornblower Cruises and Events'){
     // unset($myfeed->event);
        //echo $myfeed->asxml();

    //}

    if (++$i > 20) {
    // stop after 10 loops
    break;
}


?>

<html>
<head></head>
<body>







<div class="gs-item">
<div class="gs-itemcontent">

<h3 class="gs-cat"><?php echo $category; ?></h3>
<h2><a href="<?php echo $link; ?>" target="_blank"><?php echo $title; ?></a></h2>
<h4 class="gs-date">Date: <?php echo $dates; ?> <br/>For more show dates, <a href="<?php echo $link; ?>" target="_blank">click here</a></h4>

<img src="<?php echo $img; ?>" />
<p><?php echo $summary; ?></p>


<div id="gs-callout">
<span class="fullprice">Full Price: <?php echo $fullprice; ?></span>
<br/>
<span class="ourprice">Our Price:  <span class="gs-hilite"><?php echo $ourprice; ?></span></span>
 <p><a class="gs-button" href="<?php echo $link; ?>" target="_blank">Buy Tickets &raquo;</a></p>

</div>


<ul class="gs-venue">
<li><strong><?php echo $venue_name; ?></strong> | </li>
<li><?php echo $venue_street; ?></li>
<li><?php echo $venue_locality; ?>, <?php echo $venue_region; ?> <?php echo $venue_zip; ?></li>
<li><?php echo $venue_phone; ?></li>


</ul> 

</div>
<div class="gs-clear"></div>
</div>







    <?  endforeach; ?>



</body>

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-06-11T07:07:25+00:00Added an answer on June 11, 2026 at 7:07 am

    Use a keyed foreach

     foreach ($myfeed as $key => $goldstar):
    

    And then unset the entire current xml using the key

    unset($myfeed->$key);
    

    Or unset just the venue with unset($myfeed->$key->venue);

    Alternately, you could just build a new obj instead of trying to edit the existing one. Instantiate a new object before your loop and then only add the pieces to it that you want to keep.

    Or, you can just continue the foreach if you find the unwanted venue. The only downside is that you won’t have a copy of your ok’d list in $myfeed. So…

    if ($venue_name == 'Hornblower Cruises and Events') { continue; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Been looking around for the last few days trying to figure out what the
I have been looking around for a few hours trying to figure out how
I've been looking around the net for a good few hours now, trying to
I've been looking around the internet hoping that this is possible, I basically need
I've been looking around the net trying to find good resources for learning PostgreSQL's
I've been looking around trying to determine some Hibernate behavior that I'm unsure about.
I've been looking around the System.Xml namespace, but don't see anything that would support
I have been looking around and I cannot seem to figure out how to
I've been looking around and have only found answers in pulling out assets in
I've been looking around for quite awhile and I cannot seem to figure out

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.