php to parse ascii text from file get contents php to parse ascii text from file get contents curl curl

php to parse ascii text from file get contents


The string is already with line-break,
you can use file to convert contents from that URL into an array (each line is an array element)

A URL can be used as a filename with this function if the fopen wrappers have been enabled. See fopen() for more details on how to specify the filename. See the Supported Protocols and Wrappers for links to information about what abilities the various wrappers have, notes on their usage, and information on any predefined variables they may provide.


It's probably just the difference between an LF and a CRLF. The output from your URL is LF, which, in where you're viewing it (browser?), is probably not parsed as a new line.Try $response = str_replace("\n", "\r\n", $response); and see if this makes any difference