note 84931 added to function.preg-split

From: Date: Wed, 06 Aug 2008 13:31:30 +0000
Subject: note 84931 added to function.preg-split
Groups: php.notes 
Request: Send a blank email to php-notes+get-143210@lists.php.net to get a copy of this message
So yeah, my nice little function I posted below. Guess what, it doesn't work for all cases. If you know your way around regular expressions and the like then this might not come as a surprise, but it did surprise me. Basically, certain characters aren't welcome. If you try and include a bit of PHP in your patterns, then it might screw up your entire thing. E.g. < ? php if(!$suppressitemPHP) { (Without the spaces between the < ? and php), isn't welcome, which bit? In this case having a single '{' is the problem. And I also suspect that the '(' and ')' and maybe '<', '?' and '$' are problems as well, but I'm not so sure. I'm doing my research, and when (if) I come up with an answer, I'll post a revised function which will let me do what I want. (It may be as simple as escaping those chars in the pattern, I'm not sure.) So yeah, use the function below, it works well, just be careful is all, it doesn't work all the time. ---- Server IP: 212.124.37.9 Probable Submitter: 83.228.194.19 ---- Manual Page -- http://www.php.net/manual/en/function.preg-split.php Edit -- https://master.php.net/note/edit/84931 Del: integrated -- https://master.php.net/note/delete/84931/integrated Del: useless -- https://master.php.net/note/delete/84931/useless Del: bad code -- https://master.php.net/note/delete/84931/bad+code Del: spam -- https://master.php.net/note/delete/84931/spam Del: non-english -- https://master.php.net/note/delete/84931/non-english Del: in docs -- https://master.php.net/note/delete/84931/in+docs Del: other reasons-- https://master.php.net/note/delete/84931 Reject -- https://master.php.net/note/reject/84931 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#143210) next »