Welcome to the Cookbook

loading...

8.3.4 cleanInsert

string cleanInsert ($string, $options = array())

$options 内の 'clean' キーに従って指定された $options を使用して Set::insert でフォーマットした文字列をきれいにします。デフォルトのメソッドは text ですが、html も有効です。この関数の目的は、Set::insert で置換されない、すべてのスペース文字やプレースホルダー周辺の不必要なマークアップを置換することです。

以下のオプションをoptions配列で使うことが出来ます。

$options = array(
	'clean' => array(
		'method' => 'text', // or html
	),

	'before' => '',
	'after' => ''
);
  1. $options = array(
  2. 'clean' => array(
  3. 'method' => 'text', // or html
  4. ),
  5. 'before' => '',
  6. 'after' => ''
  7. );