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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:51:42+00:00 2026-06-14T19:51:42+00:00

This is what I currently have for my PHP file: <?php header(Content-type: text/xml); ?>

  • 0

This is what I currently have for my PHP file:

<?php header("Content-type: text/xml"); ?>
<?php echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; ?>
<rss version="2.0">
<channel>
  <title>My Website</title>
  <link>http://www.mywebsite.com</link>
  <description>The Title of My Website</description>
  <pubDate>Tue, 15 Apr 2008 18:00:00 +0000</pubDate>

  <item>
    <title>Website Directory - Page NUMBER</title>
    <pubDate><?echo date('Y/m/d H:i:s');?></pubDate>
    <link>http://www.mywebsite.com/directory/NUMBER</link>
    <description>New update to page NUMBER in the Website Directory.</description>
  </item>

</channel>
</rss>

That right there is correctly showing one entry in the RSS feed. However, I need it to show 30 entries, each with a random number entered in the three places where NUMBER is shown in the item.

Each RSS item should have a different number between 1 and 2779503 entered in the three places that say NUMBER. I know that PHP has http://php.net/manual/en/function.rand.php but what I don’t know how to do is have it loop through 30 random numbers each time the feed is loaded…

  • 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-14T19:51:44+00:00Added an answer on June 14, 2026 at 7:51 pm
    <?php
        foreach( range( 1, 30 ) as $i ):
            $number = mt_rand( 1, 2779503 );
    ?>
    <item>
        <title>Website Directory - Page <?php echo $number; ?></title>
        <pubDate><?echo date('Y/m/d H:i:s');?></pubDate>
        <link>http://www.mywebsite.com/directory/<?php echo $number; ?></link>
        <description>New update to page <?php echo $number; ?> in the Website Directory.</description>
    </item>
    <?php endforeach; ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have this code: <?php echo '<meta name=robots content=noindex>'; $arr = json_decode(file_get_contents(http://media1.clubpenguin.com/play/en/web_service/game_configs/ paper_items.json),true);
I have page which encoding is declared with <meta http-equiv=Content-Type content=text/html; charset=UTF-8 /> But
I have made a code -- <?php header(Content-type: text/javascript); require_once('../php/config.php'); $domail_theme = $_GET['theme']; ?>
I currently have a .htaccess file set up with this rule: RewriteRule ^([a-zA-Z0-9_-]+)$ user\.php?user=$1
I currently have this code which stores XML into an XML-type column called data,
I have a page with the following meta tag: <meta http-equiv=Content-Type content=text/html; charset=UTF-8 />
I currently have this piece of code: NSString *strURL = [NSString stringWithFormat:@http://www.sample.com /phpFile.php?firstname=%@,txtfirstName.text]; NSString
We currently have a working php mail script, this works fine and as we
We currently have an error catching script for all our PHP sites. This script
I currently have this sql statement that I wrote and it works but it's

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.