declare variable in php class code example
Example 1: php define class
class Bike {
function Bike() {
$this->type = 'BMX';
}
}
$blackSheep = new Bike();
print $blackSheep->type;
Example 2: declare variable in php class
<?php
class SimpleClass
{
public $var1 = 'hello';
}
?>