This may be what your looking for:
PHP Code:
<?php
function customtag($value, $text)
{
$body="The value in custom tag is $value, the custom text is $text";
//you can do whatever in here, such as call a database or whatnot.
return $body;
}
function replaceTags($body)
{
$body = preg_replace('!\<customtag=\"(.*?)\"\>(.*?)\<\/customtag\>!Uei', "''.customtag('$1','$2').''", $body);
//repeat above line for all other tags
return $body;
}
ob_start("replaceTags")
?>
<customtag="customvalue">customtext</customtag>
<!--***ALL OF YOUR HTML CODE HERE*** -->
<?
ob_end_flush();
?>
*Tested, Works, just make sure the page is less that 4MB (the default buffer size, actually it may be 4KB, I'd have to look that up
) or you'll have to use ini_set to increase the buffer
Bookmarks