In this small post i will describe how to class and object are working in PHP.Class is collection of function variables. So there is we define the several function. The functions are used with reference of class. Whenever we use any part of the class we need to crate the object. Basic example of class.
public function get_name()
public function set_name($new_name)
class_name is name of the class that you want and name is variable it store the data; There is get_name() and set_name() is the function that can perform the work.
Now use of that class
$myobject= new class_name();
Note : $myobject= new class_name(); or $myobject= new class_name;
both are same.
Just Paste the code and execute it.