<?php
class Welcome
{
public function Hello()
{
if (headers_sent()) return false;
ob_start(
function ($content)
{
header("Content-type: text/html; charset=UTF-8");
header("Content-Encoding: gzip");
$content = gzencode($content, 6);
return $content;
}
);
echo "你想學什麼?";
ob_end_flush();
}
}
$lz = new Welcome();
$lz->Hello();
<?php
class Welcome
{
public function Hello()
{
if (headers_sent()) return false;
ob_start(
function ($content)
{
header("Content-type: text/html; charset=UTF-8");
header("Content-Encoding: gzip");
$content = gzencode($content, 6);
return $content;
}
);
echo "你想學什麼?";
ob_end_flush();
}
}
$lz = new Welcome();
$lz->Hello();