'fine',
? 2 => 'overcast',
? 3 => 'rainy' );
while (ereg ('{([0-9]+)}', $text, $regs)) {
? $found = $regs[1];
? $text = ereg_replace(\{.$found.\}, $daytype[$found], $text);
}
echo $text\n;
// this is a fine day, not overcast and rainy.
?>结果:this is a fine day, not overcast and rainy
