First create to files(empty)
1) index.php
2)class_lib.php
Dont get excited on the "class_lib.php" , I will explain it later.
- we will write the whole classes within the "class_lib.php" file
- insert these code with include or require.
Example 1 : Simple php class
<?php
class Person {
}
?>
Note : I will use and modify the above code in precieding examples
Example 2 : Adding property
<?
class Person {
var $name;
}
?>
Note : "var $name" is called property . Means specifying variable name inside a class .
No comments:
Post a Comment