當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。