Blogger Information
Blog 8
fans 0
comment 0
visits 5806
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
计算图形的面积与周长-3
柯二南的博客
Original
599 people have browsed it
<?php

abstract class Shape {

    public $shapeName;

    abstract function area();

    abstract function perimoter();

    protected function validate($value, $message = '输入的值') {
        if ($value == '' || !is_numeric($value) || $value < 0) {
            $message = $this->shapeName . $message;
            echo '<font color="red">' . $message . '必须为非负值的数字,并且不能为空' . '</font><br>';
            return false;
        } else {
            return true;
        }
    }

}


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post