I am new to Php OOP's concept..i am trying to print a book name in a table(index.php) file which the book details are in different class file (FirstExample.php).I got parse error in class file.I Check my code twice..But i dont understand mistake i have done..
<?php
class FirstExample {
var $book;
var $price;
public function getBookName($bookname){
$this->book = $bookname;
echo "The bookname you Ordered is $book";
}
public function getBookPrice($bookPrice){
$this->price = $bookPrice;
echo "The Book Price is $price";
}
$physics = new FirstExample;
$chemistry = new FirstExample;
$Mathematics = new FirstExample;
$computerProgramming = new FirstExample;
$physics->getBookName("Physics");
$physics->getBookPrice("$150");
$chemistry->getBookName("Chemistry");
$chemistry->getBookPrice("$100");
$Mathematics->getBookName("Mathematics-Differential and Integral Calculas");
$Mathematics->getBookPrice("$200");
$computerProgramming->getBookName("Advanced Computer Programming");
$computerProgramming->getBookPrice("$200");
}
?>