PHP函数
网络函数
- bool checkdnsrr ( string $host [, string $type = "MX" ] )— 给指定的主机(域名)或者IP地址做DNS通信检查 - bool syslog ( int $priority , string $message )— 生成系统日志消息 - bool openlog ( string $ident , int $option , int $facility )— 打开与系统记录器的连接 - bool closelog ( void )— 关闭系统日志链接 - void define_syslog_variables ( void )— 初始化所有日志相关的变量 - resource fsockopen ( string $hostname [, int $port = -1 [, int &$errno [, string &$errstr [, float $timeout = ini_get("default_socket_timeout") ]]]] ) — 打开一个网络连接或者一个Unix套接字连接 - resource pfsockopen ( string $hostname [, int $port = -1 [, int &$errno [, string &$errstr [, float $timeout = ini_get("default_socket_timeout") ]]]] )— 打开一个持久的网络连接或者Unix套接字连接。 - bool setcookie ( string $name [, string $value = "" [, int $expire = 0 [, string $path = "" [, string $domain = "" [, bool$secure = false [, bool $httponly = false ]]]]]] )— 发送 Cookie - bool setrawcookie ( string $name [, string $value [, int $expire = 0 [, string $path [, string $domain [, bool $secure = false [, bool $httponly = false ]]]]]] )— 发送未经 URL 编码的 cookie - string gethostbyaddr ( string $ip_address )— 获取指定的IP地址对应的主机名 - string gethostbyname ( string $hostname )— 返回主机名对应的 IPv4地址。 - array gethostbynamel ( string $hostname )— 获取互联网主机名对应的 IPv4 地址列表 - string gethostname ( void )— 获取主机名 - bool getmxrr ( string $hostname , array &$mxhosts [, array &$weight ] )— 获取互联网主机名对应的 MX 记录 - int getprotobyname ( string $name )— 获取与协议名称相关联的协议号 - string getprotobynumber ( int $number )— 获取与协议号相关联的协议名称 - int getservbyname ( string $service , string $protocol )— 获取互联网服务协议对应的端口 - string getservbyport ( int $port , string $protocol )— 获取与端口和协议相对应的Internet服务 - bool header_register_callback ( callable $callback )— 调用一个 header 函数 - void header_remove ([ string $name ] )— 删除之前设置的 HTTP 头 - void header ( string $string [, bool $replace = true [, int $http_response_code ]] )— 发送原生 HTTP 头 - array headers_list ( void )— 返回已发送的 HTTP 响应头(或准备发送的) - bool headers_sent ([ string &$file [, int &$line ]] )— 检测 HTTP 头是否已经发送 - mixed http_response_code ([ int $response_code ] )— 获取/设置响应的 HTTP 状态码 - string inet_ntop ( string $in_addr )— 将已打包的Internet地址转换为可读的表示形式 - string inet_pton ( string $address )— 转换为人类可读的IP地址,其包装in_addr表示 - int ip2long ( string $ip_address )— 将一个IPV4的字符串互联网协议转换成数字格式 - string long2ip ( string $proper_address )—将长整型转化为字符串形式带点的互联网标准格式地址(IPV4) ```php header('Location: http://www.example.com/'); header("HTTP/1.0 404 Not Found"); header("Content-Type: text/html;charset=utf-8"); header("Content-Disposition: attachment; filename=" . urlencode($file)); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); header("Content-Length: " . filesize($file)); flush(); // this doesn't really matter. $fp = fopen($file, "r"); while (!feof($fp)){ echo fread($fp, 65536); flush(); // this is essential for large downloads } fclose($fp); ```
顶部
收展
底部
[TOC]
目录
PHP函数 字符串函数
PHP函数 数组函数
PHP函数 文件目录函数
日期时间函数
MySQL函数
正则函数
数学函数
cURL 函数
XML函数
加密函数
Session函数
URL函数
Apache 函数
Bzip2 压缩与归档扩展
GNU Readline 针对命令行的扩展
网络函数
进程控制
变量与类型相关扩展函数
影响 PHP 行为的扩展
相关推荐
PHP基础
PHP设计模式
PHP算法
PHP版本