Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pavanBS
Last active April 24, 2018 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavanBS/bcf2422e743140f12be97c3ccdabf03e to your computer and use it in GitHub Desktop.
Save pavanBS/bcf2422e743140f12be97c3ccdabf03e to your computer and use it in GitHub Desktop.
<?php
class Books{
public function name(){
  echoDrupal book”;
  }
  public function price(){
  echo900 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();
?>
@takdw
Copy link

takdw commented Apr 24, 2018

Line 10 should have a comment modifier since it will create errors.

<?php
class Books{
    public function name(){
        echoDrupal book”;
    }
    public function price(){
        echo900 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