次のように文字列を置き換える関数を教えてください:
文字列は引数に応じてorthe boo[k|ks] [is|are] on the table
を出力します。the book is on the table
the books are on the table
<?php
$unformated_str = "the boo[k|ks] [is|are] on the table";
$plural = true;
echo formatstr($unformated_str, $plural);
?>
出力:
the books are on the table
私の下手な英語を許してください。私の質問が十分に明確になったことを願っています。