I want to get the following data "PHPSESSID" from this script in a string:
<?php
file_get_contents('https://www.bedandbreakfast.nl/?page=ajaxcb&do=updateBookingIntent&arrival=2015-08-22&departure=2015-08-23&src=booking_arrival');
$cookies = array();
foreach ($http_response_header as $hdr) {
if (preg_match('/^Set-Cookie:\s*([^;]+)/', $hdr, $matches)) {
parse_str($matches[1], $tmp);
$cookies += $tmp;
}
}
print_r($cookies);
?>
I tried to run this script, only that wasn't working...
echo $cookies[PHPSESSID];