MediaWiki REL1_30
DoubleReplacer.php
Go to the documentation of this file.
1<?php
24class DoubleReplacer extends Replacer {
30 public function __construct( $from, $to, $index = 0 ) {
31 $this->from = $from;
32 $this->to = $to;
33 $this->index = $index;
34 }
35
40 public function replace( array $matches ) {
41 return str_replace( $this->from, $this->to, $matches[$this->index] );
42 }
43}
Class to perform secondary replacement within each replacement string.
__construct( $from, $to, $index=0)
replace(array $matches)
Base class for "replacers", objects used in preg_replace_callback() and StringUtils::delimiterReplace...
Definition Replacer.php:25