← All docs

fsockopen()

Open Internet or Unix domain socket connection.

fsockopen()

function fsockopen(string $hostname, int $port, int $error_code = null, string $error_message = null, float $timeout = null): mixed

Open Internet or Unix domain socket connection.

Parameters:

  • $hostname (string)
  • $port (int)
  • $error_code (int), passed by reference, default null, optional
  • $error_message (string), passed by reference, default null, optional
  • $timeout (float), default null, optional

Returns: mixed

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how fsockopen is implemented in the compiler, see the internals page.