preg_replaceのpattern、replacement引数には配列が使える

知りませんでした。こういう使い方ができるんですね。

<?php
$string = 'The quick brown fox jumped over the lazy dog.';
$patterns[0] = '/quick/';
$patterns[1] = '/brown/';
$patterns[2] = '/fox/';
$replacements[2] = 'bear';
$replacements[1] = 'black';
$replacements[0] = 'slow';
echo preg_replace($patterns, $replacements, $string);
?>

結果:The bear black slow jumped over the lazy dog.

普通にphpのマニュアルに載ってることなんですが、何かに使えそうな気がします。
http://phpspot.net/php/man/php/function.preg-replace.html