All pastes #980091 Raw Edit

Someone

public text v1 · immutable
·published 2008-04-10 19:59 UTC
rendered paste body
<?php

$file = 'http://localhost:8983/solr/index.html';

## File Exists
if (file_exists( $file )) {
        echo 'file_exists!';
}
else {
        echo 'file does not exist';
}

## stream_create:

$opts = array(
  'http'=>array(
    'method'=>"GET",
  )
);

$context = stream_context_create($opts);

/* Sends an http request to www.example.com
   with additional headers shown above */
$fp = fopen($file, 'r', false, $context);
echo fpassthru($fp);
fclose($fp);


#$xml = file_get_contents($file);

#$xml = simplexml_load_file($file);

#print_r($xml);

?>