-1

Possible Duplicate:
file_get_contents with https?
Problems getting XML content via https using SimpleXML and PHP

I have the URL:

Which loads a file like this one:

<calendars>
    <calendar accommodation_id="1234567">
        <day date="2012-08-09" vacancy="false" minimum_nights="7" arrival_day="true"/>
        <day date="2012-08-10" vacancy="false" minimum_nights="3" arrival_day="true"/>
        <day date="2012-08-11" vacancy="false" minimum_nights="3" arrival_day="true"/>
        ...
        <day date="2014-01-31" vacancy="true" minimum_nights="3" arrival_day="true"/>
    </calendar>
</calendars>

For some reason my script won't let me get the contents of this file. I'm using the same script as i have been with other URLs but this will always fail.

My script is:

$accom2 = file_get_contents();

print_r($accom2);

Is there something I need to do for this type of URL?

Community
  • 1
  • 1
user1482082
  • 37
  • 1
  • 2
  • 5
  • According to [this page](http://php.net/manual/en/wrappers.http.php#refsect1-wrappers.http-notes), you need openssl enabled. Do you have it enabled? (And please don't repeat a question, move back to your older one) – Alvin Wong Aug 09 '12 at 14:13
  • Please do not duplicate questions. Instead, edit your previous one. – hakre Aug 09 '12 at 16:04

2 Answers2

5

probably an answer here: (if protocol is the issue)

How to get file_get_contents() to work with HTTPS?

Community
  • 1
  • 1
N4553R
  • 188
  • 4
1

Have you tried simplexml_load_file, I tested it's working for me

<?php
$xml = simplexml_load_file('https://www.casapilot.com/api/1/accommodations/calendar.xml?auth_token=hyXHjP8QdrRuX8q3FsbC&id[]=1049165');

print_r($xml);
?>
Muthu Kumaran
  • 17,682
  • 5
  • 47
  • 70