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

  • Home
  • SEARCH
  • 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 7542627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:13:03+00:00 2026-05-30T08:13:03+00:00

I’m trying to read the contents of an external xml feed. When I view

  • 0

I’m trying to read the contents of an external xml feed. When I view the link in the browser it renders the xml contents as it should, but when I run it in my browser I get errors. My code is as follows:

<?php
$url = "http://www.thebigchoice.com/feeds/job_xml.php";

$xml = simplexml_load_file($url); 

print_r($xml);
?>

Here is the error that I’m getting:

( ! ) Warning: simplexml_load_file() [function.simplexml-load-file]: http://www.thebigchoice.com/feeds/job_xml.php:1: parser error : Start tag expected, '<' not found in C:\wamp2\www\phpAcademy\TheBigChoice\TMPr785mziagz.php on line 14
Call Stack
#   Time    Memory  Function    Location
1   0.0004  365880  {main}( )   ..\TMPr785mziagz.php:0
2   0.0004  366048  simplexml_load_file ( ) ..\TMPr785mziagz.php:14

( ! ) Warning: simplexml_load_file() [function.simplexml-load-file]: Unknown type: [8] Undefined index: HTTP_USER_AGENT<br /> in C:\wamp2\www\phpAcademy\TheBigChoice\TMPr785mziagz.php on line 14
Call Stack
#   Time    Memory  Function    Location
1   0.0004  365880  {main}( )   ..\TMPr785mziagz.php:0
2   0.0004  366048  simplexml_load_file ( ) ..\TMPr785mziagz.php:14

( ! ) Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in C:\wamp2\www\phpAcademy\TheBigChoice\TMPr785mziagz.php on line 14
Call Stack
#   Time    Memory  Function    Location
1   0.0004  365880  {main}( )   ..\TMPr785mziagz.php:0
2   0.0004  366048  simplexml_load_file ( )
  • 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-30T08:13:04+00:00Added an answer on May 30, 2026 at 8:13 am

    The output of the URL is

    Unknown type: [8] Undefined index:  HTTP_USER_AGENT<br />
    Line : 20  File :/var/www/thebigchoice/html/includes/Common/setup.php<br /><br />WARNING: [2] Cannot modify header information - headers already sent by (output started at /var/www/thebigchoice/html/includes/Common/functions.php:80)<br />
    Line : 10  File :/var/www/thebigchoice/html/includes/Common/feeds/feeds_complete_job_feed_minus_247.php<br /><br /><?xml version="1.0" encoding="utf-8"?>
    <XMLJobFeed><Job><CompanyRef>60</CompanyRef><JobTitle>Enterprise Management Training Programme</JobTitle><SummaryLocation>Worldwide</SummaryLocation><SalaryBenefits>Competative</SalaryBenefits><Summary>SWYgeW91IHNlZSB5b3Vyc2VsZiBhcyBvbmU
    

    So apparently, the script checks for the User Agent in the HTTP Request, cannot find it and then outputs errors before it sends the actual XML. It’s apparently a poorly written script.

    The solution is to set the UserAgent. You can do that globally in your php.ini or with a stream context. See my answer to How can I download using PHP a XML file redirected in some weird way? on how to achieve that.

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

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Basically, what I'm trying to create is a page of div tags, each has
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I have a French site that I want to parse, but am running into

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.