Home > JavaScript, PHP > Create PHP object without class

Create PHP object without class

Within JavaScript, you can easily create an object without the class as follows:

myObj = {};
myObj.abc = "Here we go";

Within PHP, you can do the following:

$myObj = new stdClass();
$myObj->abc = 'Here we go';
  1. No comments yet.
  1. No trackbacks yet.