Stuff
public text v1 · immutable
<?php
function simplecode($pre, $post, $target) {
$target_arr = explode("\n", $target);
$s = array();
$result = "";
foreach ($target_arr as $t):
if (preg_match("/(<input.*\/>|<textarea.*>.*<\/textarea>)/", $t)):
array_push($s, $t);
else:
$t = preg_replace($pre, $post, $t);
array_push($s, $t);
endif;
endforeach;
foreach ($s as $v):
$result .= $v."
";
endforeach;
// $result = preg_replace($pre, $post, $target);
return $result;
}
?>