# PHP/XML Parse Error

**URL:** <https://forum.kirupa.com/t/php-xml-parse-error/236838>\
**Category:** programming\
**Created:** [August 24, 2007, 2:23am UTC](https://forum.kirupa.com/t/php-xml-parse-error/236838 "2007-08-24T02:23:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bandit8](https://avatars.discourse-cdn.com/v4/letter/b/c6cbf5/32.png) [@bandit8](https://forum.kirupa.com/u/bandit8)\
**Post date:** [August 24, 2007, 2:23am UTC](https://forum.kirupa.com/t/php-xml-parse-error/236838/1 "2007-08-24T02:23:40Z")

</div>

Hi,

For the first time, I am attempting to bring data from an XML file into PHP so that I can use it… Not going too well considering I can’t even get it to load the XML file into a variable :wt: … I would love any help/suggestions you might have to help this whole process a lot easier for me.

I’m just working with test data right now…my XML file is:

```auto
  [LEFT]<?xml version="1.0" ?>
<php_programs>
   <program name="cart">
      <price>100</price>
   </program>
   <program name="survey">
      <price>500</price>
   </program>
</php_programs>[/LEFT]

```

My php code:

```php
 <?php 
       $test = simplexml load_file('php_programs.xml'); 
?> 

```

The error:

“Parse error: parse error, unexpected T\_STRING in /homepages/xmlTest/phpText.php on line 2”

(using PHP Version 5.2.1)

Can anyone please help?

Thanks!  
b.
