variable scop in php class code example
Example 1: declare variable in php class
<?php
class SimpleClass
{
public $var1 = 'hello';
}
?>
Example 2: php variable
$name = "Josh"; //$varname = value
<?php
class SimpleClass
{
public $var1 = 'hello';
}
?>
$name = "Josh"; //$varname = value