Voting

: two minus two?
(Example: nine)

The Note You're Voting On

Fredow
10 years ago
<?php
// Nice little function that convert a string to uppercase by keeping the HTMLentities intact.
public static function strtoupper_entities($str) {

$patternMajEntities = '/(\&([A-Z])(ACUTE|CEDIL|CARON|CIRC|GRAVE|ORN|RING|SLASH|TH|TILDE|UML)\;)+/';
$str = preg_replace_callback ($patternMajEntities,
function (
$matches) {
return
"&" . $matches[2] . strtolower($matches[3]) . ";";
},
strtoupper($str));

return
$str;
}

<< Back to user notes page

To Top