Do you read... [title]?
[text]
'); // $rotation_ini_file: Define the server path/file name for the INI file containing site data. // $rotation_markup: Define the markup to insert the site's data into. Use [title] for the section text. // $rotation_section_name: Define the text to replace with the section's text. function print_from_rotation($rotation_ini_file, $rotation_markup, $rotation_section_name = 'title') { // Read the lines from the INI file into an array $all_data = parse_ini_file($rotation_ini_file, true); // Pick a section get its details. $section = array_rand($all_data); $values = $all_data[$section]; // Replace keys with their values. $rotation_markup = str_replace("[$rotation_section_name]", $section, $rotation_markup); foreach ($values as $key=>$value) { $rotation_markup = str_replace("[$key]", $value, $rotation_markup); } return $rotation_markup; } ?>