background image

if (!$handle = fopen($path, 'w'))
{
return false;
}
if (!fwrite($handle, $content))
{
return false;
}
fclose($handle);
return true;
}

//用法
//by www.jbxue.com
$sampleData = array(
'first' => array(
'first-1' => 1,
'first-2' => 2,
'first-3' => 3,
'first-4' => 4,
'first-5' => 5,
),
'second' => array(
'second-1' => 1,
'second-2' => 2,
'second-3' => 3,
'second-4' => 4,
'second-5' => 5,
));
write_ini_file($sampleData, './data.ini', true);

//读 ini 文件
public function readini($name)
{
if (file_exists(SEM_PATH.'init/'.$name))
{
$data = parse_ini_file(SEM_PATH.'init/'.$name,true);
if ($data)
{
return $data;
}
}
else
{