當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Book::printBookInfo方法代碼示例

本文整理匯總了PHP中Book::printBookInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP Book::printBookInfo方法的具體用法?PHP Book::printBookInfo怎麽用?PHP Book::printBookInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Book的用法示例。


在下文中一共展示了Book::printBookInfo方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Roller

echo "<hr>Volume cone 2: <br>";
echo "Objetosc 2: ".$cone2->volume()."<br>";

echo "<hr><hr>";

$roller1 = new Roller(2, 3, "yellow", 5, 10);
$roller2 = new Roller(2, 1, "black", 2, 12);

echo "<hr>Display roller 1: <br>";
$roller1->display();
echo "<hr>Display roller 2: <br>";
$roller2->display();

echo "<hr>Volume roller 1: <br>";
echo "Objetosc 1: ".$roller1->volume()."<br>";
echo "<hr>Volume roller 1: <br>";
echo "Objetosc 2: ".$roller2->volume()."<br>";
*/
//require_once ("./src/singleton");
require_once "./src/bookmark.php";
require_once "./src/book.php";
$book1 = new Book("Wiedzmin", "Sapkowski", 4241241241, 44.5);
$bookMark1 = new Bookmark(40, "mark1 for wiedxmin");
$book1->addBookmark($bookMark1);
$bookMark2 = new Bookmark(70, "marek2 for wiedxmin");
$book1->addBookmark($bookMark2);
$book1->printBookInfo();
var_dump($book1);
$book2 = clone $book1;
$book2->setPrice(40000);
var_dump($book2);
開發者ID:marekdan,項目名稱:coders_lab,代碼行數:31,代碼來源:index.php

示例2: printBookInfo

 public function printBookInfo()
 {
     echo "Print Ebook";
     parent::printBookInfo();
     echo $this->size;
 }
開發者ID:coolbacki,項目名稱:03_oop,代碼行數:6,代碼來源:ebook.php

示例3: printBookInfo

 public function printBookInfo()
 {
     echo 'Print book info';
     parent::printBookInfo();
 }
開發者ID:kabaj,項目名稱:opp,代碼行數:5,代碼來源:Ebook.php

示例4: Book

<?php

require_once './src/book.php';
require_once './src/ebook.php';
$book1 = new Book("Tytul", "Autor", 54.66, 54345654);
$book2 = new Book("Tytul2", "Autor2", 58.66, 54945654);
$book1->printBookInfo();
$book2->printBookInfo();
$book1 = new Ebook("Tytul", "Autor", 54.66, 54345654, 300);
$book1->printBookInfo();
開發者ID:coolbacki,項目名稱:03_oop,代碼行數:10,代碼來源:01_book.php


注:本文中的Book::printBookInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。