$configData = '{"db_host": "localhost", "db_user": "root", "db_password": "password", "db_name": "my_database"}'; $jreg = new JRegistry(); $jreg->loadString($configData, 'JSON'); // access the values using $jreg->get('db_host'), $jreg->get('db_user'), etc.
$configData = "; database configuration\n db_host = localhost\n db_user = root\n db_password = password\n db_name = my_database"; $jreg = new JRegistry(); $jreg->loadString($configData, 'INI'); // access the values using $jreg->get('db_host'), $jreg->get('db_user'), etc.This JRegistry class is a part of the Joomla PHP Framework.