|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-02-04 15:15 UTC] thibaud at 42stores dot com
Description: ------------ --- From manual page: https://php.net/function.html-entity-decode --- \s meta-character in regular expression don't cache the character resulting of a html_entity_decode of a string containing " " (using utf-8). Test script: --------------- var_dump(preg_replace('/\s+/','!',html_entity_decode(' '))); Expected result: ---------------- string(1) "!" Actual result: -------------- string(2) " " PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 18:00:01 2025 UTC |
You are missing the /u modifier, to treat the string as UTF-8 and enable UCP mode: var_dump(preg_replace('/\s+/u','!',html_entity_decode(' ')));