html - PHP include text file and format -


i have simple text file. file name kpop.txt - want include contents of file in webpage. using php includes (header / footer stuff).

i contents of kpop.txt file remain formatted similar it's current form. real difference make increase font size.

i using

<?php include("kpop.txt"); ?> 

i have tried

<pre> <font size ="12"> <?php include("kpop.txt"); ?> </font> </pre> 

what want see text larger font.

ftus43 kggw 271140 taf kp01 271140z 2706/2806 08010kt p6sm sct140      fm271500 12011kt p6sm sct110      fm271900 14011kt p6sm bkn120      fm280000 14008kt p6sm vcsh bkn100      fm280300 13006kt p6sm vcsh sct100       amd not sked. unfl=  taf km75 271140z 2706/2806 07008kt p6sm sct110      fm271500 11008kt p6sm few150       amd not sked. unfl= 

another solution did not work

    <?php      myfilename = "kpop.txt";     $taf = file_get_contents(myfilename);     $taflines = explode("\n", $taf);      //echo $taf;     echo $taflines;   } ?> 

i have tried using file_get_contents function along explode function cannot seem work properly. appreciated.

i suggest use css, rather deprecated <font> tag:

<pre style="font-size:120%"> <?php echo file_get_contents('kpop.txt') ?> </pre> 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -