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:

  1. Parsing this string to get the id and date tag (string can only be one or both of these);
  2. Read the SIZE and FORMAT values; this case is 4 and ME;);
  3. 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

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -