php代码
欢迎使用“起航点卡销售系统”销售程序:一、系统优势 1、售卡系统采取了会员与非会员相结合的销售方法,客户无需注册即可购卡,亦可注册会员购卡。 2、购卡速度快,整个购卡或过程只需二步即可取卡,让客户感受超快的取卡方式! 3、批量加卡功能。 4、取卡方式:网上支付,即时取卡 ,30秒可完成交易。 5、加密方式:MD5 32位不可倒推加密 6、防止跨站
0
<?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号