note 54420 added to function.nl2br

From: Date: Mon, 04 Jul 2005 02:32:18 +0000
Subject: note 54420 added to function.nl2br
Groups: php.notes 
Request: Send a blank email to php-notes+get-91383@lists.php.net to get a copy of this message
When exporting multiline strings to Flash I've encountered problems with double spacing when using nl2br so I made a very short yet powerfull function. <?php function nl2br4flash( $str ) { return eregi_replace( 13, '<br>', $str ); } ?> Hope that helped anyone at all, I know it took quite some time for me to solve the bug. ---- Manual Page -- http://www.php.net/manual/en/function.nl2br.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54420 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54420&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54420&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54420&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54420&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54420&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54420&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54420&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91383) next »