What are some alternative methods to read and write INI files in PHP without using PEAR?

To read and write INI files in PHP without using PEAR, you can utilize the built-in functions `parse_ini_file()` to read an INI file and `parse_ini_string()` to read an INI string. For writing, you can manually construct the INI content as a string and write it to a file using `file_put_contents()`.

// Read an INI file
$ini_array = parse_ini_file('config.ini');

// Read an INI string
$ini_string = "[section]\nkey1=value1\nkey2=value2";
$ini_array = parse_ini_string($ini_string);

// Write to an INI file
$ini_content = "[section]\nkey1=value1\nkey2=value2";
file_put_contents('config.ini', $ini_content);