Fork me on GitHub

I/O



Files

Provide a simple temporary to permanent data store.


Constants


File Modes


Locks


File Functions

Access controll

Note that the results of a call to any of these functions will be cached, so that two calls to a given function on the same stream resource and during the same script will return the same value, regardless of whether the underlying resource has changed in the meantime.


Streams


Types


Components


Stream Functions


Sockets

1
2
<?php
$fp = fsockopen("example.preinheimer.com", 80, $errno, $errstr, 30)

Contexts

http://php.net/manual/en/context.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
$opts = array(
  'http'=>array(
    'method'=>"GET",
    'header'=>"Accept-language: en\r\n" .
              "Cookie: foo=bar\r\n"
  )
);

$context = stream_context_create($opts);

/* Sends an http request to www.example.com
   with additional headers shown above */
$fp = fopen('http://www.example.com', 'r', false, $context);
fpassthru($fp);
fclose($fp);
blog comments powered by Disqus