Home  >  Article  >  php教程  >  ANSI颜色码转HTML

ANSI颜色码转HTML

WBOY
WBOYOriginal
2016-06-21 09:05:541202browse

此方法是一字一字往下抓ANSI颜色码转换,有点土法炼钢。当前和大部分TELNET软件
比较不同是他们换行就有自动作退出码,而我这个并没有作。

 
<code><font color=&quot;#000000&quot;><font color=&quot;#0000bb&quot;></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;><br>Echo </font><font color=&quot;#dd0000&quot;>&quot;<pre class=&quot;brush:php;toolbar:false&quot;>&quot;</pre></font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>Echo </font><font color=&quot;#0000bb&quot;>ANSI_2_HTML</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>Fread</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>Fopen</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#dd0000&quot;>&quot;1.txt&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;r&quot;</font><font color=&quot;#007700&quot;>),</font><font color=&quot;#0000bb&quot;>FileSize</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#dd0000&quot;>&quot;1.txt&quot;</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>)));<br>Echo </font><font color=&quot;#dd0000&quot;>&quot;&quot;</font></font><font face=&quot;新宋体&quot; color=&quot;#007700&quot;>;<br></font><font face=&quot;新宋体&quot;><font color=&quot;#ff8000&quot;>## ANSI 转换成 HTML<br></font><font color=&quot;#007700&quot;>Function </font><font color=&quot;#0000bb&quot;>ANSI_2_HTML</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>$String</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>){<br><br>   </font><font color=&quot;#0000bb&quot;>$ANSI_Light</font><font color=&quot;#007700&quot;>=Array(</font><font color=&quot;#dd0000&quot;>&quot;0&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;000000&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;1&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#FF0000&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;2&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#00CC00&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;3&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#FFFF00&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;4&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#3366FF&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;5&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#CC33CC&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;6&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#66FFFF&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;7&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#FFFFFF&quot;</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>);<br>   </font><font color=&quot;#0000bb&quot;>$ANSI_Dark </font><font color=&quot;#007700&quot;>=Array(</font><font color=&quot;#dd0000&quot;>&quot;0&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;000000&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;1&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#840000&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;2&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#008200&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;3&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#AD4100&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;4&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#000084&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;5&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#840084&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;6&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#00B6B5&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>&quot;7&quot;</font><font color=&quot;#007700&quot;>=></font><font color=&quot;#dd0000&quot;>&quot;#C6C7C6&quot;</font></font><font face=&quot;新宋体&quot; color=&quot;#007700&quot;>);<br>   <br>   </font><font face=&quot;新宋体&quot;><font color=&quot;#ff8000&quot;>## 颜色样本同CNEWS      <br><br>   </font><font color=&quot;#0000bb&quot;>$flag_have_ansi</font><font color=&quot;#007700&quot;>= </font><font color=&quot;#0000bb&quot;>0</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>   </font><font color=&quot;#0000bb&quot;>$dl            </font><font color=&quot;#007700&quot;>= </font><font color=&quot;#0000bb&quot;>0</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;         <br>   </font><font color=&quot;#0000bb&quot;>$flag_hava_bg  </font><font color=&quot;#007700&quot;>= </font><font color=&quot;#0000bb&quot;>0</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br><br>   </font><font color=&quot;#0000bb&quot;>$String</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>Str_replace</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>Chr</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>27</font><font color=&quot;#007700&quot;>).</font><font color=&quot;#dd0000&quot;>'[m'</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#0000bb&quot;>Chr</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>27</font><font color=&quot;#007700&quot;>).</font><font color=&quot;#dd0000&quot;>'[0m'</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#0000bb&quot;>$String</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>);<br>   <br>   For(</font><font color=&quot;#0000bb&quot;>$i</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>0</font><font color=&quot;#007700&quot;>;</font><font color=&quot;#0000bb&quot;>$i</font><font color=&quot;#007700&quot;><font color=&quot;#0000bb&quot;>Strlen</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>$String</font><font color=&quot;#007700&quot;>);</font><font color=&quot;#0000bb&quot;>$i</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>++):<br>      If(</font><font color=&quot;#0000bb&quot;>$String</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$i</font><font color=&quot;#007700&quot;>]==</font><font color=&quot;#0000bb&quot;>Chr</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>27</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>)):<br>         </font><font color=&quot;#0000bb&quot;>$lastString</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>Substr</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>$String</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#0000bb&quot;>$i</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#0000bb&quot;>Strlen</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>$String</font><font color=&quot;#007700&quot;>)-</font><font color=&quot;#0000bb&quot;>$i</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>);         <br>         If(</font><font color=&quot;#0000bb&quot;>Ereg</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>Chr</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>27</font><font color=&quot;#007700&quot;>).</font><font color=&quot;#dd0000&quot;>&quot;\[([0-8;]{0,}[^m])m&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#0000bb&quot;>$lastString</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>)):<br>            </font><font color=&quot;#0000bb&quot;>$ansicode</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>Substr</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>$lastString</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#0000bb&quot;>2</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#0000bb&quot;>Strpos</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>$lastString</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>'m'</font><font color=&quot;#007700&quot;>)-</font><font color=&quot;#0000bb&quot;>2</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>);<br>            </font><font color=&quot;#0000bb&quot;>$i</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>$i</font><font color=&quot;#007700&quot;>+</font><font color=&quot;#0000bb&quot;>Strpos</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>$lastString</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#dd0000&quot;>'m'</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>);<br>            </font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>Split</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#dd0000&quot;>&quot;;&quot;</font><font color=&quot;#007700&quot;>,</font><font color=&quot;#0000bb&quot;>$ansicode</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>);<br>            If(</font><font color=&quot;#0000bb&quot;>Is_Array</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>)) </font><font color=&quot;#0000bb&quot;>Sort</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>$Rendition</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>);<br>            For(</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>0</font><font color=&quot;#007700&quot;>;</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;><font color=&quot;#0000bb&quot;>count</font><font color=&quot;#007700&quot;>(</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>)-</font><font color=&quot;#0000bb&quot;>1</font><font color=&quot;#007700&quot;>;</font><font color=&quot;#0000bb&quot;>$j</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>++):<br>               </font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>]=(int)</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>];<br>               If(</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>]==</font><font color=&quot;#dd0000&quot;>'1'</font><font color=&quot;#007700&quot;>) </font><font color=&quot;#0000bb&quot;>$dl</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>1</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>               If(</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>]==</font><font color=&quot;#dd0000&quot;>'0'</font><font color=&quot;#007700&quot;>) </font><font color=&quot;#0000bb&quot;>$dl</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>0</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>               <br>               </font><font color=&quot;#0000bb&quot;>$ansi</font><font color=&quot;#007700&quot;>=(</font><font color=&quot;#0000bb&quot;>$dl</font><font color=&quot;#007700&quot;>==</font><font color=&quot;#dd0000&quot;>'0'</font><font color=&quot;#007700&quot;>) ? </font><font color=&quot;#0000bb&quot;>$ANSI_Dark </font><font color=&quot;#007700&quot;>: </font><font color=&quot;#0000bb&quot;>$ANSI_Light</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br><br>               If(</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>]<font color=&quot;#0000bb&quot;>10</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>):<br>                  If(</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>]==</font><font color=&quot;#0000bb&quot;>0</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>) :<br>                     </font><font color=&quot;#0000bb&quot;>$style</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#dd0000&quot;>&quot;background-color:#000000;text-decoration:none;&quot;</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>                     </font><font color=&quot;#0000bb&quot;>$tempBg</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#dd0000&quot;>&quot;&quot;</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>                  EndIf;<br>                  If(</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>]==</font><font color=&quot;#0000bb&quot;>1</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>) <br>                     </font><font color=&quot;#0000bb&quot;>$style</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#dd0000&quot;>&quot;color:#ffffff;&quot;</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>                  If(</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>]==</font><font color=&quot;#0000bb&quot;>4</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>) <br>                     </font><font color=&quot;#0000bb&quot;>$style</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>$style</font><font color=&quot;#007700&quot;>.</font><font color=&quot;#dd0000&quot;>&quot;text-decoration:underline;&quot;</font></font><font face=&quot;新宋体&quot; color=&quot;#007700&quot;>;            <br>                  </font><font face=&quot;新宋体&quot; color=&quot;#ff8000&quot;># 5 blink on<br>                  # 7 reverse video on<br>                  # 8 nondisplayed (invisible) 缺 不知道如何实作显示,但大部分后三者用不到<br>               </font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>EndIf;               <br>               If(</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>]>=</font><font color=&quot;#0000bb&quot;>30</font><font color=&quot;#007700&quot;>&&</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>]<font color=&quot;#0000bb&quot;>37</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>):<br>                  </font><font color=&quot;#0000bb&quot;>$style</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>$style</font><font color=&quot;#007700&quot;>.</font><font color=&quot;#dd0000&quot;>&quot;color:&quot;</font><font color=&quot;#007700&quot;>.</font><font color=&quot;#0000bb&quot;>$ansi</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>]%</font><font color=&quot;#0000bb&quot;>10</font><font color=&quot;#007700&quot;>].</font><font color=&quot;#dd0000&quot;>&quot;;&quot;</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>                  </font><font color=&quot;#0000bb&quot;>$style</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>$style</font><font color=&quot;#007700&quot;>.</font><font color=&quot;#0000bb&quot;>$tempBg</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>               EndIf;<br>               If(</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>]>=</font><font color=&quot;#0000bb&quot;>40</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>):               <br>                  </font><font color=&quot;#0000bb&quot;>$flag_hava_bg </font><font color=&quot;#007700&quot;>= </font><font color=&quot;#0000bb&quot;>1</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>                  </font><font color=&quot;#0000bb&quot;>$style</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>$style</font><font color=&quot;#007700&quot;>.</font><font color=&quot;#dd0000&quot;>&quot;background-color:&quot;</font><font color=&quot;#007700&quot;>.</font><font color=&quot;#0000bb&quot;>$ANSI_Dark</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>]%</font><font color=&quot;#0000bb&quot;>10</font><font color=&quot;#007700&quot;>].</font><font color=&quot;#dd0000&quot;>&quot;;&quot;</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;                  <br>                  </font><font color=&quot;#0000bb&quot;>$tempBg</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#dd0000&quot;>&quot;background-color:&quot;</font><font color=&quot;#007700&quot;>.</font><font color=&quot;#0000bb&quot;>$ANSI_Dark</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$Rendition</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$j</font><font color=&quot;#007700&quot;>]%</font><font color=&quot;#0000bb&quot;>10</font><font color=&quot;#007700&quot;>].</font><font color=&quot;#dd0000&quot;>&quot;;&quot;</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>               EndIf;<br>            EndFor;<br>            <br>            If(</font><font color=&quot;#0000bb&quot;>$flag_have_ansi</font><font color=&quot;#007700&quot;>==</font><font color=&quot;#0000bb&quot;>1</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>):<br>               </font><font color=&quot;#0000bb&quot;>$font</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#dd0000&quot;>&quot;<span>&quot;</span></font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>            ElseIf(</font><font color=&quot;#0000bb&quot;>$flag_have_ansi</font><font color=&quot;#007700&quot;>==</font><font color=&quot;#0000bb&quot;>0</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>):<br>               </font><font color=&quot;#0000bb&quot;>$flag_hava_bg </font><font color=&quot;#007700&quot;>= </font><font color=&quot;#0000bb&quot;>0</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>               </font><font color=&quot;#0000bb&quot;>$tempBg       </font><font color=&quot;#007700&quot;>=</font><font color=&quot;#dd0000&quot;>&quot;&quot;</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>               </font><font color=&quot;#0000bb&quot;>$font</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#dd0000&quot;>&quot;<span>&quot;</span></font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>            EndIf;<br>            </font><font color=&quot;#0000bb&quot;>$flag_have_ansi</font><font color=&quot;#007700&quot;>=</font><font color=&quot;#0000bb&quot;>1</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;<br>            </font><font color=&quot;#0000bb&quot;>$myansi</font><font color=&quot;#007700&quot;>.=</font><font color=&quot;#0000bb&quot;>$font</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>;   <br>         EndIf;<br>      Else:<br>         </font><font color=&quot;#0000bb&quot;>$myansi</font><font color=&quot;#007700&quot;>.=</font><font color=&quot;#0000bb&quot;>$String</font><font color=&quot;#007700&quot;>[</font><font color=&quot;#0000bb&quot;>$i</font></font><font face=&quot;新宋体&quot;><font color=&quot;#007700&quot;>];<br>      EndIf;<br>   EndFor;<br>   Return </font><font color=&quot;#dd0000&quot;>&quot;&quot;</font><font color=&quot;#007700&quot;>.</font><font color=&quot;#0000bb&quot;>$myansi</font></font><font face=&quot;新宋体&quot; color=&quot;#007700&quot;>;   <br>}</font><font color=&quot;#0000bb&quot;></font></font></font></font></font></font>


下图为TELNET软件浏览


下图为浏览器浏览



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:安全下载与断点续传Next article:php 分析rss代码