App\services\Utils::getStringReplaced PHP 메소드

getStringReplaced() 공개 정적인 메소드

Replace content of string according to given rules
public static getStringReplaced ( string $str, array $rules ) : string
$str string
$rules array
리턴 string
    public static function getStringReplaced($str, $rules)
    {
        foreach ($rules as $search => $replace) {
            $str = str_replace($search, $replace, $str);
        }
        return $str;
    }