sorting - Capitalize first letter in PHP using RegEx? -


I have the following data in a notepad file:

  A 1-6 A 1 -7B 1-8B1-9B 1-10 C1-11C1-12D1-13F1-14F1-15F1-16  

I The Notepad file must update according to the statistics given below:

  & lt; Strong & gt; A & lt; / Strong> 1-6 A 1-7 & lt; Strong & gt; B & lt; / Strong> 1-8 B1- 9b 1-10 Lieutenant; Strong & gt; C & lt; / Strong> 1-11 c1-12 & lt; Strong & gt; D & lt; / Strong> 1-13 & lt; Strong & gt; F. & lt; / Strong> 1-14F1-15F1-16  

Which means that a and tags tag or alphabetical alphabetical alphabetical data in the file alphabetical Sorted by form (A to Z)

I want to use RegEx technology in PHP, please help!

Thank you.

I will do something like this:

  $ view = array () ; $ File = array ('A1-6', 'A1-7', 'b1-8', 'b1-9', 'b 1-10', 'c1-11', 'c1 -12 ',' D1-13 ',' F1-14 ',' F1-15 ',' F-16-16 '); Foreign Currency ($ file as $ line) {$ L = Strutuper (substrust ($ line, 0, 1)); If (! Isset ($ $ [$ L] has been viewed) {$ line = preg_replace ('! ^ (.)!', '& Lt; strong & gt; $ 1 & lt; / strong & gt; , $ Line); $ [$ L] = 1;} $ line echo, "\ n";}  

Output:

  ; Strong & gt; A & lt; / strong & gt; 1-6 A 1-7 & lt; strong & gt; B & lt; / strong & gt; 1-8B1-9b 1-10 and Lieutenant ; Strong & gt; c & lt; / strong> 1-11 c12-12 & lt; strong & gt; d & lt; / strong & gt; 1-13 & lt; strong & gt; F & lt; ; / Strong> 1-14F1-15F1-16  

Comments