PHP COURSE • LESSON 39
PHP Constructors
A constructor runs automatically when an object is created.
constructor.php
<?php
class User{
function __construct(){
echo "User Created";
}
}
$user=new User();
?>