For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > June 2005 > Reading Linux-files









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Reading Linux-files
M. de Vogel

2005-06-03, 8:55 pm

Hello,

I want to read a file in PHP. The file is made in Linux, so the
problem is: a have no line-ends.
The file is like:
line 1□line2□□line3□line4


The line-end is in Linux replaced by a □. How to convert it back
to a line-end??

How to read those files???



Kind regards,
M. de Vogel
SpoonfulofTactic@gmail.com

2005-06-03, 8:55 pm

$data = str_replace("□", "\n", $data);

But, if im not mistaken, those are HTML special characters. So, just
in case your file has more, unrecognizeable characters:

$data = html_entity_decode($data);

Unchecked, of course.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com