Good proof of concept. Now to extract it into a function so you only need to change
PHP Code:
<!--bof Product Name-->
<h1 id="productName" class="productGeneral"><?php echo $products_name; ?></h1>
<!--eof Product Name-->
to
PHP Code:
<!--bof Modified Product Name-->
<h1 id="productName" class="productGeneral"><?php echo text_swap($products_name); ?></h1>
<!--eof Modified Product Name-->
In /includes/functions/extra_functions/text_swap_functions.php
PHP Code:
<?php
// The text string
//$newprodname = $products_name;
function text_swap($text) {
$old = array('Body Con', 'body con');
$new = array('Going Out', 'going out');
// Run through the text and replace all occurrences of $oldText
$newtext = str_replace($old , $new , $text);
return $newtext;
}
?>
Bookmarks