WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : An updated OOP - Inheritance
Categories : PHP, PHP Classes, Object Oriented Click here to Update Your Picture
Juma Nabongo
Date : Apr 26th 2003
Grade : 3 of 5 (graded 7 times)
Viewed : 11801
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Juma Nabongo
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?php
                /*PHP supports inheritance. Inheritance is the concept of one class being
                devined as a special case of a more general class.
                A Sport car is a car it inherits all its variables and functions from Car*/
                
class Car {
         var $description; //The aim here is to display the description and the cost of car!
         var $cost;

         function Car($d, $c) {
                        $this->set($d, $c);
                        }

                        function display() {
                        echo ("<br>$this->description, $this->cost");
                        }

                        function set($d,$c) {
                                $this->description = $d;
                                $this->cost = $c;
                        }

                        function setDescription($d) {
                                $this->description = $d;
                        }

                        function getDescription() {
                                return $this->description;
                        }
                }

         class sportcar extends Car {
                var $tyres;

                function sportcar($d, $c, $t) {
                        $this->set($d, $c);
                        $this->tyres = $t;
                        }

                function displays() { //This is a function to display items named ie tyres
                        echo "<br>$this->tyres"; // Here is to display the number of tyres
                        $this->display();                        
                        }
                }
        
                $ordinary = new Car("Ford", 29050.00); // Constructor - new car
                $scar = new sportcar("Porshe",900000.00,4); // Constructor - new sportcar

                $ordinary->display();
                $scar->displays(); //scar : Sportcar
                ?>



Football News Aggregator
Categories : PHP, Object Oriented, PHP Classes, Rich Site Summary (RSS), HTML and PHP
Advanced Image WaterMarker
Categories : PHP, PHP Classes, GD image library, Graphics, Object Oriented
Access_user Class - an easy to use system for protecting pages and register users.
Categories : PHP, Classes and Objects, Object Oriented, PHP Classes, Authentication
My Box - PHP Class that calculates the volumetric weight of a package.
Categories : PHP, Object Oriented, PHP Classes, Beginner Guides, Payment Gateways
EasyPhpThumbnail Class - The EasyPhpThumbnail class allows you to generate thumbnails and handle image manipulation for GIF, JPG and PNG on-the-fly.
Categories : PHP, PHP Classes, Object Oriented, Graphics, GD image library
OO Site Template
Categories : PHP, PHP Classes, Object Oriented
SPL and ITERATOR : examples
Categories : PHP, Object Oriented, PHP Classes, Sessions
Three Cool Classes and One Trick
Categories : PHP, PHP Classes, Graphics, Email
Timer - a class that uses microtime() to provide easy calculation of elapsed times
Categories : Algorithms, PHP, PHP Classes
Specify your connection settings and create a link to a MySQL database.
Categories : PHP, PHP Classes, Databases, MySQL, Beginner Guides
Mssql database Manager
Categories : PHP, Databases, MS SQL Server, Classes and Objects, PHP Classes
file class , uploade file , download file already uploaded on another website
Categories : PHP, PHP Classes, Filesystem, Web Services
A beginner's session handling class
Categories : PHP, PHP Classes, Sessions, Beginner Guides
Simple Template Class/Example
Categories : PHP, Templates, PHP Classes
Database and Recordset classes fo SyBASE Usage is obvious.
Categories : Sybase, Databases, PHP Classes, PHP