[pmwiki-users] Beginner preg_replace question

Octocias octocias at googlemail.com
Sat Apr 8 08:59:09 CDT 2006


The following does not work for me.. Can you tell me why?

I have a string which contains variable names. I want to replace the
variables in the string with the actual variable values.


SDV($TemplText, '' );

$TmplText = "(:table border=5:)\n(:cellnr:) $Name\n(:tableend:)\n";

function replace( $Name )
{
   global $TemplText;

   return preg_replace( "/\\$Name/", "$Name", $TemplText );
}

TIA

--
Octocias
http://www.octocias.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20060408/65f7afba/attachment.html 


More information about the pmwiki-users mailing list