Accepts a key-value array of replacements, the key beeing the value to be replaced, the value beeing the replacement.

category Formagic
package Filter
author Florian Sonnenburg
copyright Copyright (c) 2009 Florian Sonnenburg
version $Id: Replace.php 169 2012-05-06 20:16:16Z meweasle $

 Methods

Constructor

__construct(array $replacements) 

Parameters

$replacements

array

Find-Replace-Array

Replaces strings according to the replacements array.

filter(mixed $value) : mixed

Uses the PHP function strtr() for replacing.

Parameters

$value

mixed

The value to be filtered

Returns

mixedThe filtered value

 Properties

 

Array containing the replacements

$_replacements : array