note 83386 added to function.htmlentities
| From: | nacho dot exr at gmail dot com | Date: | Fri, 23 May 2008 10:25:39 +0000 |
| Subject: | note 83386 added to function.htmlentities | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139636@lists.php.net to get a copy of this message | ||
For the <mat at matinfo dot ch> function 'convertLatin1ToHtml'
a performance improvement: use strtr instead of str_replace:
foreach ($html_entities as $key => $value) {
$str = str_replace($key, $value, $str);
}
goes to:
$str = strtr($str,$html_entities);
that's all ;)
----
Server IP: 130.206.1.5
Probable Submitter: 213.60.143.117
----
Manual Page -- http://www.php.net/manual/en/function.htmlentities.php
Edit -- https://master.php.net/note/edit/83386
Del: integrated -- https://master.php.net/note/delete/83386/integrated
Del: useless -- https://master.php.net/note/delete/83386/useless
Del: bad code -- https://master.php.net/note/delete/83386/bad+code
Del: spam -- https://master.php.net/note/delete/83386/spam
Del: non-english -- https://master.php.net/note/delete/83386/non-english
Del: in docs -- https://master.php.net/note/delete/83386/in+docs
Del: other reasons-- https://master.php.net/note/delete/83386
Reject -- https://master.php.net/note/reject/83386
Search -- https://master.php.net/manage/user-notes.php