Re: [PHP] help with \n\r in strings

2006-12-29 Thread Manolet Gmail
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

Re: [PHP] help with \n\r in strings

2006-12-29 Thread Arpad Ray
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 eac

Re: [PHP] help with \n\r in strings

2006-12-29 Thread Robert Cummings
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() par

Re: [PHP] help with \n\r in strings

2006-12-29 Thread Frank Arensmeier
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 accompl

RE: [PHP] help with \n\r in strings

2006-12-29 Thread Peter Lauri
Try: $string_as_array = explode("\n", $string); echo ""; print_r($string_as_array); echo ""; 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 - personal

Re: [PHP] help with \n\r in strings

2006-12-29 Thread Robert Cummings
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 n