Miscellany
public text v1 · immutable<?php
$string = '<foo>hej</foo>';
$pattern = '/(<foo>+)(\w+)(<\/foo>+)/i'; // \w står for noget i retning af word boundary
$replacement = '<bar>$2</bar>';
echo preg_replace($pattern, $replacement, $string);
echo "\n";
?>