professional-search-06-seophp-include-custom-markup.inc.php / php
<?php function custom_markup_translate(// array with regular expressions that match custom tags search = array( '#{bold}(.*?){/bold}#is', '#{italic}(.*?){/italic}#is', '#{underline}(.*?){/underline}#is', '#{heading}(.*?){/heading}#is', '#{subheading}(.*?){/subheading}#is', '#{link:(.*?)}(.*?){/link}#is', '#{elink:(.*?)}(.*?){/elink}#is', '#{unordered-list}(.*?){/unordered-list}\s*#is', '#{ordered-list}(.*?){/ordered-list}\s*#is', '#\\s*{list-element}(.*?){/list-element}\s*#is', '#{picture:(.*?)}#is', '#\t#', '#{comment}(.*?){/comment}#is' ); // array with HTML replacements <b>\\1</b>', '<i>\\1</i>', '<u>\\1</u>', '<h1 class=some_class>\\1</h1>', '<h2 class=some_other_class>\\1</h2>', '<a href=\'\\1\'>\\2</a>', '<a href=\'\\1\' target="_blank">\\2</a>', '<ul>\\1</ul>', '<ol>\\1</ol>', '<li>\\1</li>', '<img src="\\1" border="0">', '', '' ); // perform the replacement step_1 = preg_replace(replace, step_2 = preg_split('#({HTML}.*?{/HTML})#is', return = ''; foreach (s2) { if (preg_match('#{HTML}#', return .= preg_replace('#{/?HTML}#is', '', return .= nl2br(// return HTML markup return return; } ?>
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.