note 20051 modified in function.ereg by sander

From: Date: Wed, 10 Apr 2002 13:00:08 +0000
Subject: note 20051 modified in function.ereg by sander
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-29065@lists.php.net to get a copy of this message
One useful way to replace a new line character "\n" within your code COMPLETELY it to use this: $comments = ereg_replace("(.\n)", "<br >", $comments); This makes a msg that comes into your prog looking like this: "Hey ... Mucho Bueno" Turn into this: "Hey ...<br ><br >Mucho Bueno" This is useful for people who keep a .txt file database, with each line in that database refering to one entry ... NOTE the spaces in the break return tags "<br >", this is so they will be displayed on this page, please remove the spaces ... --was-- One useful way to replace a new line character "\n" within your code COMPLETELY it to use this: $comments = ereg_replace("(.\n)", "<br>", $comments); This makes a msg that comes into your prog looking like this: "Hey ... Mucho Bueno" Turn into this: "Hey ...<br ><br >Mucho Bueno" This is useful for people who keep a .txt file database, with each line in that database refering to one entry ... http://www.php.net/manual/en/function.ereg.php

« previous php.notes (#29065) next »