PHP面向对象教程之自定义类(3)


public function size($width, $height) {
        $this->w = $width;
        $this->h = $height;
        return $this;
    }

返回当前的对象,这样就可以用图片 使用(这个)大小,另存为(这里)$simg->size(200, 200)->save("2.jpg");这样一个符合oop思想的类封装完成了。

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/82ad6b86f1e3c0a457a24f9fbf8eb748.html