Back to OutputFilter class

Method ampReplaceCallback

public static string
ampReplaceCallback
(mixed $m)
Callback method for replacing & with & in a string
Parameters
  • string $m String to process
Returns
  • string Replaced string
Since
  • 3.5
Class: OutputFilter
Project: Joomla

Method ampReplaceCallback - Source code

/**
 * Callback method for replacing & with & in a string
 *
 * @param   string  $m  String to process
 *
 * @return  string  Replaced string
 *
 * @since   3.5
 */
public static function ampReplaceCallback($m)
{
    $rx = '&(?!amp;)';
    return preg_replace('#' . $rx . '#', '&', $m[0]);
}