Wednesday, April 8, 2015

Class in PHP

In this short code that I wrote it will show you how to create a class in PHP and how to create an object based on the class that we have written. This code will give you a first hand experience how to write a code in PHP using Object Ortiend Approach in programming.

If you like my work please send me an email at jakerpomperada@gmail.com andjakerpomperada@yahoo.com.

People here in the Philippines who wish to contact me can call and text me in this number 09173084360.

Thank you very much and God Bless.




Sample Program Output


Program Listing

<?php

class message {

 public $Name ="John Doe";
 public $Age = 56;
 public $Address = "Washington Street, USA";
 public $Work ="Janitor";
 }

  $info = new message;

 echo "<font size='5'>";
 echo "Name     : ".$info->Name."<br>";
 echo "Age      : ".$info->Age."<br>";
 echo "Address  : ".$info->Address."<br>";
 echo "Work     : ".$info->Work."<br>"; 
 echo "</font>";

 ?>

No comments:

Post a Comment