<?php
function txtarea($nb,$ht="88vh") {
$json = json_encode($nb, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
return "<textarea style='display:inline; height:$ht;width:38vw;'>$json</textarea>";
}
if (function_exists('opcache_get_status')) {
$status = opcache_get_status();
if ($status && $status['opcache_enabled']) {
echo "<p>OPcache is enabled.</p>";
} else {
echo "<p>OPcache is not enabled.</p>";
}
} else {
echo "<p>OPcache function does not exist.</p>";
}
// 检查OPcache扩展是否已启用
if (function_exists('opcache_get_configuration')) {
$opcache_config = opcache_get_configuration();// 获取OPcache配置信息
echo txtarea($opcache_config);
$opcache_status = opcache_get_status();// 获取OPcache状态信息
echo txtarea($opcache_status);
} else {
echo "<p>OPcache 不支持!</p>";
}
?>