Q:

Write a simple PHP class which displays the following string

0

Write a simple PHP class which displays the following string.

'MyClass class has initialized !'

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now