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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:46:20+00:00 2026-05-19T12:46:20+00:00

I am working on a schedule system that collects information from a RSS feed.

  • 0

I am working on a schedule system that collects information from a RSS feed. However, when I try to strip the necessary segment from the RSS preg_match returns it as invalid.

//Finds the day by stripping data from the myDragonnet RSS feed.
function schedule($given_date) {
    $url = "http://mydragonnet.hkis.edu.hk/schedule/day_schedule_rss.php?schedule_id=1";
    $rss = simplexml_load_file($url);
    $date = date("~jS M Y~", strtotime($given_date)); 
    if($rss) {
        foreach($rss->channel->item as $item) {
            foreach ($item->title as $story) {
                if (strpos($date, $story) !== false) {
                    preg_match("/Day (\d+)/", $story, $m);
                    break; // stop searching
                }   
            } 
        }
    }
    return $m[1];
}

The function : <?php echo schedule('01/24/2010'); ?>

This is the error I’m getting –

Warning: preg_match() [function.preg-match]: Unknown modifier '/' in ***/class.schedule.php on line 31
  • 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-19T12:46:21+00:00Added an answer on May 19, 2026 at 12:46 pm

    try this:

    // Finds the day by stripping data from the myDragonnet RSS feed.
    function schedule($given_date) {
        $url = "http://mydragonnet.hkis.edu.hk/schedule/day_schedule_rss.php?schedule_id=1";
        $rss = simplexml_load_file($url);
        $date = date("jS M Y", strtotime($given_date)); 
        $found = false;
    
        if($rss) {
            foreach($rss->channel->item as $item) {
                foreach ($item->title as $story) {
                    if (strpos($story, $date) !== false) {
                        if (preg_match('/Day (\d+)/i', $story, $m)) {
                            $found = true;
                            break; // stop searching
                        }
                    }   
                }
    
                if ($found)
                {
                    break;
                } 
            }
        }
        return $m[1];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on an application that allows people to schedule Shows for an
I'm working on a scheduling system in Java that sends out reminders based on
I have a schedule task that is making a webrequest. This was all working
I'm working on a third-party program that aggregates data from a bunch of different,
I'm working on a little web crawler that will run in the system tray
I'm currently working on a site that has a hidden section (schedule, rates). When
I'm working on a project that screen scrapes a list of departure times from
I am working on a game for iOS and I have to schedule an
Working on a bunch of forms at the moment and I'm finding that I
Working on a website that has Employee and Branch entities, using a database table

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.