w32api_register_function()不能用!帮忙啊。 这个函数只存在于 4.2.0到4.2.3版本的PHP中是一个试验性扩展模块,现已经取消了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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.txtdefine("MB_OK", 0);// Load the extension indl("php_w32api.dll");// Register the GetTickCount function from kernel32.dllw32api_register_function("kernel32.dll", "GetTickCount", "long");// Register the MessageBoxA function from User32.dllw32api_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 textMessageBoxA(NULL, $str, "Uptime Information", MB_OK);?> svn 疑云 为什么什么也没有显示? 请问各位高手php中如何不POST取文本框的值? php取得最小值的一条数据 关于各种采样数据的曲线图表的数据清洗,拟合,图表生成,局部放大,多种数据对比分析问题 数据关联问题。。算法问题..有点难. PHP如何访问ORACLE的数据集,用存储过程 这样的系统报价多少? 我狂晕那,谁知道什么情况下php.ini在winnt下会失效,不能加载? phpmywind上传图片到服务器 在哪里修改上传服务器的路径 如何把表格(tab2)中的数据插入到表(charge)中? 可以编辑的表格是如何实现的?
介绍
这是对于 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);
?>