标签:adapter function cti json 数据 get parent ext print
// 数据源类
class Weather { public static function getWether() { $data = array( ‘tep‘ => 28, ‘wind‘ => 5, ‘sun‘ => ‘sunny‘ ); return serialize($data); } }
// 适配不同客户端 class Adapter extends Weather { public static function getWether() { return $data = json_encode(unserialize(parent::getWether())); } } echo ‘<br>‘; print_r(Adapter::getWether());
标签:adapter function cti json 数据 get parent ext print
原文地址:https://www.cnblogs.com/xiangdongsheng/p/13369609.html