Re: help with \n\r in strings

From: Date: Fri, 29 Dec 2006 10:33:07 +0000
Subject: Re: help with \n\r in strings
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-246276@lists.php.net to get a copy of this message
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 backwards. 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 (#246276) next »