This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
uphp:functions:fsockopen [2017/03/27 16:42] jeff |
uphp:functions:fsockopen [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
======fsockopen====== | ======fsockopen====== | ||
+ | |||
< | < | ||
Line 5: | Line 6: | ||
====Description==== | ====Description==== | ||
- | <well size=" | + | |
- | <span style=" | + | <well size=" |
- | < | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
+ | <span style=" | ||
</ | </ | ||
Line 21: | Line 23: | ||
====Parameters==== | ====Parameters==== | ||
- | < | ||
- | < | + | <html><b>< |
- | < | + | <html><b>< |
- | ====Return Value==== | + | < |
- | Upon success it returns a file handle which may be used together with the other file functions that require a handle such as [[fgets()]], [[fwrite()]], [[fclose()]] and [[feof()]] | + | |
- | If the attempt to open the connection fails it will return 0 | + | ====Return Values==== |
+ | < | ||
+ | |||
+ | The file handle may be used together with the other file functions that require a handle such as [[fgets()]], | ||
====Example==== | ====Example==== | ||
- | **Create a connection to www.example.com and display the response:** | + | |
+ | ===Create a connection to www.example.com and display the response=== | ||
<code php> | <code php> | ||
Line 54: | Line 58: | ||
</ | </ | ||
- | ====See Also==== | + | ====Also |
+ | |||
+ | [[fopen()]] - Open a file for reading or writing | ||
[[fseropen()]] - Open the serial port at the specified baud rate with optional parameters | [[fseropen()]] - Open the serial port at the specified baud rate with optional parameters | ||
[[f485open()]] - Open the RS-485 port at the specified baud rate and parity | [[f485open()]] - Open the RS-485 port at the specified baud rate and parity | ||
- | [[fopen()]] - Open a file for reading | + | [[fread()]] - Read bytes from a file, stream |
- | [[fclose()]] - Close a file, stream or socket | + | [[fgets()]] - Return a single line from a file, stream or socket, with optional size limit |
- | [[feof()]] - Test if no more data is available in a file or stream | + | [[fwrite()]] - Write data to a file, stream |
- | [[fgets()]] - Return a single line from a file or stream, with optional size limit | + | [[feof()]] - Test if no more data is available in a file, stream |
- | [[fread()]] - Return | + | [[filesize()]] - Return |
- | [[fwrite()]] - Write data to a file or stream | + | [[fseek()]] - Position the file pointer in an open file |
+ | |||
+ | [[ftell()]] - Return the current position of a file read/write pointer | ||
+ | |||
+ | [[fclose()]] - Close a file, stream | ||