php代码
一个功能强大的黄页查询系统,支持两级行业和地区分类功能,动态生成静态的企业资料网页,大大减轻了服务器负担提高网络推广效果,后台批量管理分类和企业信息,本系统的扩展功能强大,能方便快捷地建立一个功能强大的黄页查询平台
10
<?php
interface IImage{
function getHeight();
function getWidth();
function getData();
}
class Image_PNG implements IImage{
private $_width,$_height,$_data;
public function __construct($file){
$this->_file=$file;
$this->_parse();
}
private function _parse(){
//完成PNG格式的解析工作
//并填充$_width、$_height和$_data
}
public function getWidth(){
return $this->_width;
}
public function getHeight(){
return $this->_height;
}
public function getData(){
return $this->_data;
}
}
class Image_JPEG implements IImage{
private $_width ,$_height,$_data;
public function __construct($file){
$this->_file=$file;
$this->_parse();
}
private function _parse(){
}
public function getWidth(){
return $this->_width;
}
public function getHeight(){
return $this->_height;
}
public function getData(){
return $this->_data;
}
}
class ImageFactory{
public static function factory($file){
$pathParts=pathinfo($file);
switch(strtolower($pathParts['extension'])){
case 'jpg';
$ret=new Image_JPEG($file);
break;
case 'png';
$ret=new Image_PNG($file);
break;
default;
}
if($ret instanceof IImage){
return $ret;
}
else{
}
}
}
$image=ImageFactory::factory('/path/to/b/bei.jpg');
echo $image->getWidth();
?>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号