Asp.NET,PHP,JAVA,JavaScript & HTML Questions and Answers
You can write your records by the help of this blog...
Pages
Home
ASP.NET
PHP
HTML
JavaScript
JAVA
HTML Tags
Monday, 8 February 2016
Class and Object in PHP
Code:
<?php
echo "<center>";
echo "<h1>Class and Object</h1>";
class human
{
public $gender='Male';
}
$Johnny = new human;
echo 'Johnny is a '. $Johnny->gender.'.';
echo "</center>";
?>
Output:
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment