Re: help with \n\r in strings

From: Date: Fri, 29 Dec 2006 09:57:00 +0000
Subject: Re: help with \n\r in strings
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-246273@lists.php.net to get a copy of this message
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 row are connected but it appears as a space but I've done all > kinds of tests like $spacePos = strrpos($dateAmount, ' '); but this is > always empty. > > 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)? > > Thanks in advance. strpos( $dateAmount, "\n" ) or strpos( $dateAmount, "\r" ) Double quotes are required for expansion of special characters. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

« previous php.general (#246273) next »