这个函数只存在于 4.2.0到4.2.3版本的PHP中
是一个试验性扩展模块,现已经取消了

解决方案 »

  1.   

    W32api 函数库
    介绍
    这是对于 DLL 的通用扩展 API。它最初是用来允许从 PHP 中访问 Win32 API,尽管这样你仍然可以通过它访问其它 DLL。 这个函数支持当前 PHP 标准的类型(string,boolean,float,integer 和 null)以及你使用 w32api_deftype() 函数所自定义的类型。 
    警告 
    本扩展模块是实验性的。该模块的行为,包括其函数的名称以及其它任何关于此模块的文档可能会在没有通知的情况下随 PHP 以后的发布而改变。我们提醒您在使用本扩展模块的同时自担风险。 
     需求
    这个扩展只能工作在 Windows 系统中。 安装
    这些函数作为 PHP 核心的一部分,无需被安装即可使用。运行时配置
    该扩展模块未定义任何设置指令。资源类型
    这个扩展定义了一个资源类型,被用作用户自定义类型。这个类型的名称是 "dynaparm"。 预定义常量
    由于这些常量是由该扩展模块定义的,因此只有在该扩展模块被编译到 PHP 中,或者在运行时被动态加载后,这些常量才有效。
    DC_MICROSOFT (integer)DC_BORLAND (integer)DC_CALL_CDECL (integer)DC_CALL_STD (integer)DC_RETVAL_MATH4 (integer)DC_RETVAL_MATH8 (integer)DC_CALL_STD_BO (integer)DC_CALL_STD_MS (integer)DC_CALL_STD_M8 (integer)DC_FLAG_ARGPTR (integer)范例
    这个例子演示如何得到系统持续运行的时间,并把它显示在一个消息对话框中。 例子 1. 得到系统持续运行的时间,并把它显示在消息对话框中<?php
    // Define constants needed, taken from
    // Visual Studio/Tools/Winapi/WIN32API.txt
    define("MB_OK", 0);// Load the extension in
    dl("php_w32api.dll");// Register the GetTickCount function from kernel32.dll
    w32api_register_function("kernel32.dll",
                             "GetTickCount",
                             "long");// Register the MessageBoxA function from User32.dll
    w32api_register_function("User32.dll",
                             "MessageBoxA",
                             "long");// Get uptime information
    $ticks = GetTickCount();// Convert it to a nicely displayable text
    $secs  = floor($ticks / 1000);
    $mins  = floor($secs / 60);
    $hours = floor($mins / 60);$str = sprintf("You have been using your computer for:".
                    "\r\n %d Milliseconds, or \r\n %d Seconds".
                    "or \r\n %d mins or\r\n %d hours %d mins.",
                    $ticks,
                    $secs,
                    $mins,
                    $hours,
                    $mins - ($hours*60));// Display a message box with only an OK button and the uptime text
    MessageBoxA(NULL,
                $str,
                "Uptime Information",
                MB_OK);
    ?>