Subject: | Was wondering why search and replace... |
Summary: | Package rating comment |
Messages: | 3 |
Author: | RicardoSaracino |
Date: | 2010-12-07 16:26:04 |
Update: | 2010-12-07 17:42:30 |
|
|
|
RicardoSaracino rated this package as follows:
Utility: | Good |
Consistency: | Good |
Documentation: | Not sure |
Examples: | Not sure |
|
RicardoSaracino - 2010-12-07 16:26:08
Was wondering why search and replace data structures are not in a single associative array?
Really nice implementation, was thinking of implementing something similar but with a subset of tags
Ramunas - 2010-12-07 17:38:27 - In reply to message 1 from RicardoSaracino
Thanks for rating this class!
The answer to your question is that it's because of preg_replace function declaration. It has individual parameters for search patterns array and replacements array.
See http://php.net/manual/en/function.preg-replace.php for details.
If I had one associative array, I would have to separate array keys from values. I just didn't want to do that :)
RicardoSaracino - 2010-12-07 17:42:30 - In reply to message 2 from Ramunas
Makes perfect sense, i'm sure if i would have really *read* the code instead of skimming it i would have noticed.
|