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

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -