当前位置: 首页>>代码示例>>PHP>>正文


PHP Subscriber::display方法代码示例

本文整理汇总了PHP中Subscriber::display方法的典型用法代码示例。如果您正苦于以下问题:PHP Subscriber::display方法的具体用法?PHP Subscriber::display怎么用?PHP Subscriber::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Subscriber的用法示例。


在下文中一共展示了Subscriber::display方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Subscriber

<?php

$object = new Subscriber();
$object->name = "Fred";
$object->password = "pword";
$object->phone = "012 345 6789";
$object->email = "fred@bloggs.com";
$object->display();
class User
{
    public $name, $password;
    function save_user()
    {
        echo "Save User code goes here";
    }
}
class Subscriber extends User
{
    public $phone, $email;
    function display()
    {
        echo "Name:  " . $this->name . "<br>";
        echo "Pass:  " . $this->password . "<br>";
        echo "Phone: " . $this->phone . "<br>";
        echo "Email: " . $this->email;
    }
}
开发者ID:ganganimaulik,项目名称:robinNixon4thEd,代码行数:27,代码来源:example5-24.php

示例2: Subscriber

echo "Test B: " . $temp->get_sp() . "<br/>";
echo "Test C: " . $temp->static_property . "<br/>";
class Test
{
    static $static_property = "I am static";
    function get_sp()
    {
        return self::$static_property;
    }
}
$object1 = new Subscriber();
$object1->name = "Kelvin";
$object1->password = "Password";
$object1->phone = "010 203902929";
$object1->email = "0101010@qq.com";
$object1->display();
class User1
{
    public $name, $password;
    function save_user()
    {
        echo "Save User code goes here.";
    }
}
class Subscriber extends User
{
    public $phone, $email;
    function display()
    {
        echo "Name : " . $this->name . "<br/>";
        echo "Pass : " . $this->password . "<br/>";
开发者ID:HopeXKelvin,项目名称:FE-Practice,代码行数:31,代码来源:form-test.php

示例3: display

    function __construct($name_, $pass_, $phone_, $email_)
    {
        User::__construct($name_, $pass_);
        // call parent constructor
        // We will not default call it
        $this->phone = $phone_;
        $this->email = $email_;
    }
    function display()
    {
        User::save_user();
        // call function in parent class.
        // we can also do Subscriber::function_name();
        echo "Name: " . $this->name . "<br>";
        echo "Password: {$this->password} <br>";
        echo "Phone: {$this->phone} <br>";
        echo "Email: {$this->email} <br>";
    }
    final function copyright()
    {
        // final means cannot be changed for its subclass.
        echo "Copyright: This class could not be changed for its subclasses! <br>";
    }
}
$sub = new Subscriber("Beibin1", "pass1", 9017343790, "beibin@qq.com");
$sub->display();
$sub->copyright();
?>
	</body>
</html>
开发者ID:BeibinLi,项目名称:Study-Note,代码行数:30,代码来源:ch05.php


注:本文中的Subscriber::display方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。