stream_is_local
Check if the stream is a local stream
Function name: stream_is_local()
Applicable version: PHP 5 >= 5.2.4, PHP 7
Function description: The stream_is_local() function is used to determine whether the given stream is a local file stream.
usage:
bool stream_is_local ( mixed $stream )
parameter:
Return value:
Example:
// 示例1:检查本地文件流$stream = fopen('example.txt', 'r'); if (stream_is_local($stream)) { echo '该流是本地文件流'; } else { echo '该流不是本地文件流'; } fclose($stream); // 示例2:检查文件路径是否为本地文件流$filePath = 'example.txt'; if (stream_is_local($filePath)) { echo '该文件路径是本地文件流'; } else { echo '该文件路径不是本地文件流'; }
Notes: