Answer the question
In order to leave comments, you need to log in
How to make data readable?
In general, I take a txt file from a certain site and display it on my site via file_get_content + echo ().
Everything is successfully displayed, but it has an extremely unpleasant appearance - the font is standard, all the lines have strayed into one whole text. How to make the text on my site (second screenshot) look like on the other one (first screenshot). Using HTML won't help since my site will be used for the same scraping by other users.
Answer the question
In order to leave comments, you need to log in
Might fit like that
$text = file_get_contents( "././text.txt"); // 125.141.200.54:80 182.110.222.10:35419 187.44.14.19:8050
$replace = preg_replace('/(\s)/', "$1\n", $text);
echo $replace;
echo nl2br($text);
This will add a newline on the page after each address (assuming there is a newline in the source text)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question