$jRegistry = new JRegistry; $jRegistry->set('key1', 'Hello World');
$jRegistry = new JRegistry; $jRegistry->set('key2', array('name'=>'John','age'=>35));
$jRegistry = new JRegistry; $obj = new stdClass; $obj->name = 'John'; $obj->age = 35; $jRegistry->set('key3', $obj);In the above examples, we create a new instance of the JRegistry object and set the value of different keys using the set() method. The first argument of set() method is the key name and the second argument is the value. JRegistry is a part of the Joomla! CMS package library.