Jump to content

file() not showing spaces correctly


jrbilodeau

Recommended Posts

Hi,

 

I'm working on a site that i post some guitar tabs and music with cords. i upload the music a .txt files which is fine, except when i try to read in that file, the not all spaces show up correctly so now the cords don't show up over the right words.

 

this is what i tried to display the contents of the txt file on the page

 

$content = file("_files/music/electric/$electric");
$j = count($content);
for($i=0; $i < $j; $i++){
   print "<font size=2 face=\"Lucida Console\">$content[$i]</font><br>";
}

 

i also tried this but got the same results.

 

$file = fopen("_files/music/electric/$electric", "r") or exit("Unable to open file!");
while(!feof($file)){
   echo fgets($file). "<br />";
}
fclose($file);

 

Any suggestions of how to display the contents of the txt file on the webpage with all the spaces correctly?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/148224-file-not-showing-spaces-correctly/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.