zoukankan      html  css  js  c++  java
  • 影响 PHP 行为的扩展和网络函数

    <?php
    /*
     * 
     * 影响 PHP 行为的扩展
     * PHP 选项和信息
     * 
     * 
    assert_options — 设置/获取断言的各种标志
    assert — 检查一个断言是否为 FALSE
    cli_get_process_title — Returns the current process title
    cli_set_process_title — Sets the process title
    dl — 运行时载入一个 PHP 扩展
    extension_loaded — 检查一个扩展是否已经加载
    gc_collect_cycles — 强制收集所有现存的垃圾循环周期
    gc_disable — 停用循环引用收集器
    gc_enable — 激活循环引用收集器
    gc_enabled — 返回循环引用计数器的状态
    get_cfg_var — 获取 PHP 配置选项的值
    get_current_user — 获取当前 PHP 脚本所有者名称
    get_defined_constants — 返回所有常量的关联数组,键是常量名,值是常量值
    get_extension_funcs — 返回模块函数名称的数组
    get_include_path — 获取当前的 include_path 配置选项
    get_included_files — 返回被 include 和 require 文件名的 array
    get_loaded_extensions — 返回所有编译并加载模块名的 array
    get_magic_quotes_gpc — 获取当前 magic_quotes_gpc 的配置选项设置
    get_magic_quotes_runtime — 获取当前 magic_quotes_runtime 配置选项的激活状态
    get_required_files — 别名 get_included_files
    getenv — 获取一个环境变量的值
    getlastmod — 获取页面最后修改的时间
    getmygid — 获取当前 PHP 脚本拥有者的 GID
    getmyinode — 获取当前脚本的索引节点(inode)
    getmypid — 获取 PHP 进程的 ID
    getmyuid — 获取 PHP 脚本所有者的 UID
    getopt — 从命令行参数列表中获取选项
    getrusage — 获取当前资源使用状况
    ini_alter — 别名 ini_set
    ini_get_all — 获取所有配置选项
    ini_get — 获取一个配置选项的值
    ini_restore — 恢复配置选项的值
    ini_set — 为一个配置选项设置值
    magic_quotes_runtime — 别名 set_magic_quotes_runtime
    main — 虚拟的main
    memory_get_peak_usage — 返回分配给 PHP 内存的峰值
    memory_get_usage — 返回分配给 PHP 的内存量
    php_ini_loaded_file — 取得已加载的 php.ini 文件的路径
    php_ini_scanned_files — 返回从额外 ini 目录里解析的 .ini 文件列表
    php_logo_guid — 获取 logo 的 guid
    php_sapi_name — 返回 web 服务器和 PHP 之间的接口类型
    php_uname — 返回运行 PHP 的系统的有关信息
    phpcredits — 打印 PHP 贡献者名单
    phpinfo — 输出关于 PHP 配置的信息
    phpversion — 获取当前的PHP版本
    putenv — 设置环境变量的值
    restore_include_path — 还原 include_path 配置选项的值
    set_include_path — 设置 include_path 配置选项
    set_magic_quotes_runtime — 设置当前 magic_quotes_runtime 配置选项的激活状态
    set_time_limit — 设置脚本最大执行时间
    sys_get_temp_dir — 返回用于临时文件的目录
    version_compare — 对比两个「PHP 规范化」的版本数字字符串
    zend_logo_guid — 获取 Zend guid
    zend_thread_id — 返回当前线程的唯一识别符
    zend_version — 获取当前 Zend 引擎的版本
     * 
     * 
     * 请严重注意不要轻易使用以上函数,很容易导致运行环境出问题,以下代码全部被注释就是这个原因
     * 
     */
    
    
    //ini_set();
    //echo ini_get("post_max_size");
    
    //if(extension_loaded('curl')){
    //    echo 'OK';
    //}
    
    
    /*
     * 
     * php网络函数
     * 
     *
    1.checkdnsrr — 给指定的主机(域名)或者IP地址做DNS通信检查
    2.closelog — Close connection to system logger 关闭系统连接日志
    3.define_syslog_variables — Initializes all syslog related variables
    4.dns_check_record — 别名 checkdnsrr
    5.dns_get_mx — 别名 getmxrr
    6.dns_get_record — 获取指定主机的DNS记录
    7.fsockopen — 打开一个网络连接或者一个Unix套接字连接
    8.gethostbyaddr — 获取指定的IP地址对应的主机名
    9.gethostbyname — Get the IPv4 address corresponding to a given Internet host name
    10.gethostbynamel — Get a list of IPv4 addresses corresponding to a given Internet host name
    11.gethostname — Gets the host name
    12.getmxrr — Get MX records corresponding to a given Internet host name 获得mx记录
    13.getprotobyname — Get protocol number associated with protocol name
    14.getprotobynumber — Get protocol name associated with protocol number
    15.getservbyname — Get port number associated with an Internet service and protocol
    16.getservbyport — Get Internet service which corresponds to port and protocol
    17.header_register_callback — Call a header function
    18.header_remove — Remove previously set headers
    19.header — 发送一个自定义的http报文
    20.headers_list — Returns a list of response headers sent (or ready to send)
    21.headers_sent — Checks if or where headers have been sent
    22.http_response_code — Get or Set the HTTP response code
    23.inet_ntop — Converts a packed internet address to a human readable representation
    24.inet_pton — Converts a human readable IP address to its packed in_addr representation
    25.ip2long — Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address
    26.long2ip — Converts an (IPv4) Internet network address into a string in Internet standard dotted format
    27.openlog — Open connection to system logger
    28.pfsockopen — 打开一个持久的网络连接或者Unix套接字连接。
    29.setcookie — Send a cookie
    30.setrawcookie — Send a cookie without urlencoding the cookie value
    31.socket_get_status — 别名 stream_get_meta_data
    32.socket_set_blocking — 别名 stream_set_blocking
    33.socket_set_timeout — 别名 stream_set_timeout
    34.syslog — Generate a system log message
    
     * 
     */
    echo getmygid();//获取当前 PHP 脚本拥有者的 GID
    echo '<br><br><br>';
    
    echo getmyuid() ;//获取 PHP 脚本所有者的 UID
    echo '<br><br><br>';
    
    echo get_current_user();//获取当前 PHP 脚本所有者名称
    echo '<br><br><br>';
    
    echo getmyinode();//获取当前脚本的索引节点(inode)
    echo '<br><br><br>';
    
    echo getlastmod();//获取页面最后修改的时间
    echo '<br><br><br>';
    
    $r =  dns_get_record("web.gz.1251229535.clb.myqcloud.com");//给指定的主机(域名)或者IP地址做DNS通信检查
    var_dump($r);
    echo '<br><br><br>';
    
    echo checkdnsrr("web.gz.1251229535.clb.myqcloud.com");//获取指定主机的DNS记录 注意!如果有路由器或者交换映射,会导致查询到ip地址和实际不对
    echo '<br><br><br>';
    
    echo gethostbyname("web.gz.1251229535.clb.myqcloud.com");//获取ipv4地址对应的Internet主机名
    echo '<br><br><br>';
    
    $ee =  gethostbynamel("web.gz.1251229535.clb.myqcloud.com");//获取列表的IPv4地址对应于一个给定的Internet主机名
    var_dump($ee);
    echo '<br><br><br>';
    
    //echo gethostbyaddr("web.gz.1251229535.clb.myqcloud.com");//获取指定的IP地址对应的主机名 
    //echo '<br><br><br>';
  • 相关阅读:
    DLL文件是什么?
    regsvr32的作用是什么?
    win10 解决.net framework 3.5 (安装报错 0x80240438)
    git 常用命令
    Wine使用初体验
    Windows 桌面快捷方式图标变白的问题
    WSL使用初体验/WIN10下安装ubuntu20.04
    Windows 重新安装Microsoft Store/用户无权进入WindowsApps文件夹
    linux命令
    linux命令
  • 原文地址:https://www.cnblogs.com/zx-admin/p/4350936.html
Copyright © 2011-2022 走看看