Question : declare variable in php class
Answered by : excited-emu-gv0ljy1efdq1
<?php
class SimpleClass
{
public $var1 = 'hello';
}
?>
Source : https://www.php.net/manual/en/language.oop5.properties.php | Last Update : Sat, 31 Oct 20
Question : php define class
Answered by : victorious-vulture
class Bike { function Bike() { $this->type = 'BMX'; }
}
$blackSheep = new Bike();
print $blackSheep->type;
Source : | Last Update : Wed, 18 Mar 20
Question : php declare variable
Answered by : niki-romagnoli
// just assign it some value to declare it
$var = 'some value';
Source : | Last Update : Wed, 24 Feb 21
Question : how to declare variable in php
Answered by : ahmed-issah
<?php //declaring a variable in php $name = "Ahmed Issah"; $age = 23;
?>
Source : | Last Update : Sun, 31 Jul 22