<?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.2 $ --> <!-- splitted from ./en/functions/pcre.xml, last change in rev 1.47 --> <refentry id="function.preg-replace-callback"> <refnamediv> <refname>preg_replace_callback</refname> <refpurpose>Perform a regular expression search and replace using a callback</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>mixed</type><methodname>preg_replace_callback</methodname> <methodparam><type>mixed</type><parameter>pattern</parameter></methodparam> <methodparam><type>mixed</type><parameter>callback</parameter></methodparam> <methodparam><type>mixed</type><parameter>subject</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>limit</parameter></methodparam> </methodsynopsis> <para> The behavior of this function is almost identical to <function>preg_replace</function>, except for the fact that instead of <parameter>replacement</parameter> parameter, one should specify a <parameter>callback</parameter> that will be called and passed an array of matched elements in the subject string. The callback should return the replacement string. This function was added in PHP 4.0.5. </para> <para> See also <function>preg_replace</function>. </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->