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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:58:55+00:00 2026-05-26T19:58:55+00:00

I have a random url, set as a string in PHP, Example: $u=’http://www.google.com/feedtest/something’; I

  • 0

I have a random url, set as a string in PHP, Example:

$u='http://www.google.com/feedtest/something';

I am using simpleXML to get the feed from $u

How would you identify if the url is a feed (RSS,XML, ..) before downloading it with simpleXML?

  • 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-26T19:58:56+00:00Added an answer on May 26, 2026 at 7:58 pm

    You should be able to use get_headers() (see man page):

    $url = 'http://www.example.com';
    print_r(get_headers($url, 1));
    

    Would give you back the following printout:

    Array
    (
        [0] => HTTP/1.1 200 OK
        [Date] => Sat, 29 May 2004 12:28:14 GMT
        [Server] => Apache/1.3.27 (Unix)  (Red-Hat/Linux)
        [Last-Modified] => Wed, 08 Jan 2003 23:11:55 GMT
        [ETag] => "3f80f-1b6-3e1cb03b"
        [Accept-Ranges] => bytes
        [Content-Length] => 438
        [Connection] => close
        [Content-Type] => text/html
    )
    

    So you could use something like:

    $headers = get_headers($url, 1);
    
    if($headers['Content-Type'] == 'application/rss+xml') {
        // read the file
    }
    

    As long as the server you are requesting these files from actually sends the correct response headers for RSS data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have random Product Links URL. I want the result Like > http://yourdomain.com/index.php?main_page=product_info&products_id=5 Product
I have the following code in JS: new Ajax.Request('http://www.some_random_url.com', { parameters: { start :
I have some random string, let's say : s = This string has some
Here's what I need to do. I'm using Google Chrome. I have page that
Okay, lets say I have a URL like so, which is mapped via HTTP
Here are my requirements: I need to encrypt a string in PHP using AES
How can I search for in table_a table_b table_c , which have a random
I have a pseudo random number generator (PRNG) class that I want to unit
Possible Duplicate: True random number generator I have worked with random functions in python,ruby,
I have a range of random numbers. The range is actually determined by the

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.