On Fri, 2006-12-29 at 11:42 +0200, Angelo Zanetti wrote:
Hi all,
I receive a text file with a whole bunch of strings. and each line is
terminated by what I presume is \n\r however when I read the string into
PHP, it seems that the last column of the row and the first column of
the next
Try:
$string_as_array = explode(\n, $string);
echo pre;
print_r($string_as_array);
echo /pre;
The array that you get will contain segments of the string that is separated
with \n. Let me know if that helps.
Best regards,
Peter Lauri
www.dwsasia.com - company web site
www.lauri.se -
If you just want to test for \n\r -
if ( substr ( -2, $my_string ) == \n\r ) { // substr with the
negative value of 2 will give you the last two characters of your string
// do some stuff
}
I think it would be a good idea to explain a little bit more what you
are trying to
On Fri, 2006-12-29 at 11:17 +0100, Frank Arensmeier wrote:
If you just want to test for \n\r -
if ( substr ( -2, $my_string ) == \n\r ) { // substr with the
negative value of 2 will give you the last two characters of your string
// do some stuff
}
You have your substr() parameters
Angelo Zanetti wrote:
So is there a way to test for \r\n? or what else can I use to delimit
these two values (last column of row and first column of next row)?
Since it's coming from a file, you might as well just read it with
file(), which will split
2006/12/29, Arpad Ray [EMAIL PROTECTED]:
Angelo Zanetti wrote:
So is there a way to test for \r\n? or what else can I use to delimit
these two values (last column of row and first column of next row)?
mmm what about open the file with and hex editor?.. or mmm notepad++
have a option to see
6 matches
Mail list logo