note 116810 added to function.preg-replace-callback

From: Date: Tue, 03 Mar 2015 15:35:27 +0000
Subject: note 116810 added to function.preg-replace-callback
Groups: php.notes 
Request: Send a blank email to php-notes+get-201847@lists.php.net to get a copy of this message
// 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; } ---- Server IP: 72.52.91.14 Probable Submitter: 74.57.191.95 ---- Manual Page -- http://php.net/manual/en/function.preg-replace-callback.php Edit -- https://master.php.net/note/edit/116810 Del: integrated -- https://master.php.net/note/delete/116810/integrated Del: useless -- https://master.php.net/note/delete/116810/useless Del: bad code -- https://master.php.net/note/delete/116810/bad+code Del: spam -- https://master.php.net/note/delete/116810/spam Del: non-english -- https://master.php.net/note/delete/116810/non-english Del: in docs -- https://master.php.net/note/delete/116810/in+docs Del: other reasons-- https://master.php.net/note/delete/116810 Reject -- https://master.php.net/note/reject/116810 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201847) next »