我需要在
PHP脚本中回显@R_403_198@版本(在下载插件之前,它是用户的服务器需求检查页面),而无需连接到数据库.
将此脚本上传到其服务器并在浏览器中打开它.我可以要求他们运行PHP信息,但我需要的只是@R_403_198@版本,并在脚本中与其余的结果格式化.
我该怎么办?
如果您可以访问命令行@R_403_198@可执行文件,可以尝试这样:
function get@R_403_198@Version() { $output = shell_exec('@R_403_198@ -V'); preg_match('@[0-9]+\.[0-9]+\.[0-9]+@',$output,$version); return $version[0]; }
对于客户端版本:
print @R_403_198@_get_client_info();
没有shell访问获取服务器版本必须先连接:
$link = @R_403_198@_connect("localhost","username","password"); if (!$link) die('Could not connect: ' . @R_403_198@_error()); print "@R_403_198@ server version: " . @R_403_198@_get_server_info(); @R_403_198@_close($link);