|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-04-22 18:54 UTC] citricacid at tlen dot pl
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 22:00:01 2025 UTC |
Description: ------------ I try to preg_grep an array which contains some html strings. Each line is an array element. If the expression string matches searched string from the beginnig to the end then everything is fine. If the expression string matches a substring then an empty value is returned. Reproduce code: --------------- Array - $templateArray: [9] <textarea name="senddata"> [10] {ccms:textile} [11] </textarea><br /> [12] <input type="hidden" value="{ccms:idmenu}" name="ccmsid" id="ccmsid"> Code: $cml = preg_grep("/\{ccms:.+\}/", $templateArray) echo "<pre>"; print_r($cml); echo "</pre>"; Expected result: ---------------- Array ( [10] => {ccms:textile} [12] => <input type="hidden" value="{ccms:idmenu}" name="ccmsid" id="ccmsid"> ) Actual result: -------------- Array ( [10] => {ccms:textile} [12] => )