-
-
Save pavanBS/bcf2422e743140f12be97c3ccdabf03e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Books{ | |
public function name(){ | |
echo “Drupal book”; | |
} | |
public function price(){ | |
echo “900 Rs/-”; | |
} | |
} | |
To create php object we have to use a new operator. Here php object is the object of the Books Class. | |
$obj = new Books(); | |
$obj->name(); | |
$obj->price(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 10 should have a comment modifier since it will create errors.