parsing - Parse and replace text with PHP -
I have a string like this: "N- {id size = '4'} / {date format = 'm - why '} ". Now I need it:
- Parsing this string to get the id and date tag (string can only be one or both of these);
- Read the SIZE and FORMAT values; this case is 4 and ME;);
- Instead of the string with this N-0030/112014: where 30 is the ID value (it is an integer in any case), but I need 2 zeros because the size of the value is 4 and the date 112014 (November 2014 is in MI format, the format value can change).
How can I do this?
Comments
Post a Comment