function oa_core_replace_tags in Open Atrium Core 7.2
Helper function to replace HTML tags in $str.
Parameters
$str - string to process:
$tags - array of oldtag=>newtag items:
Return value
string
1 call to oa_core_replace_tags()
- oa_core_trim_text in includes/
oa_core.util.inc - Trim text to a specified length Similar to views_trim_text or the Smart Trim module but includes consistent options for removing tags needed by OA2
File
- includes/
oa_core.util.inc, line 1463 - Code for Utility functions for OpenAtrium spaces
Code
function oa_core_replace_tags($str, $tags) {
foreach ($tags as $old => $new) {
$str = preg_replace("~<(/)?{$old}>~", "<\\1{$new}>", $str);
}
return $str;
}