Answers for "php define new object"

PHP
4

php define object

$x = new stdClass();
Posted by: Guest on February-19-2020
-1

how to create object in php

//define a class
class MyClass{
  //create properties, constructor or methods
}

//create object using "new" keyword
$object = new MyClass();
 
//or wihtout parenthesis
$object = new MyClass;
Posted by: Guest on April-25-2020

Browse Popular Code Answers by Language