Thank you so much it works...
My mistake actually i was not running this from localhost, i had been trying to open this from ...
C:\Users\user\xampp\htdocs\test\class.php
I am loving this php challenges, thank u all so much both these codes work now,,,
Damian_;11002318 wrote:maybe this???
<html>
<head>
<title>opensoftworkshop.com</title>
</head>
<body>
<?php
class book
{
public $var = 'Book Name: Software Engineering';
public function Bookdetails()
{
echo $this->var;
}
}
$a = new book();
$a-> Bookdetails();
?>
</body>
</html>
[/code]