<?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();
學腳本前應該先學好OOP概念, 再去學語言流程, 再學語言結構, 雖然大部分人和我也不是這樣順序學WWW
祝LZ「碼」運亨通, 能讀會上面的碼就證明LZ能入門了~ |