PHP Exercise and solutions: Displaying following string – codzhub

Displaying following string

Sample Solution:

PHP Code:

<?php
class MyClass {
  public function __construct() 
  {
   echo 'MyClass class has initialized !'."\n";
  }
 }
$userclass = new MyClass;
?>

Sample Output:

MyClass class has initialized !

Leave a Reply

Your email address will not be published. Required fields are marked *