Re: eregi function?
| From: | John W. Holmes | Date: | Tue, 25 Nov 2003 23:12:42 +0000 |
| Subject: | Re: eregi function? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-170957@lists.php.net to get a copy of this message | ||
Jas wrote:
Not sure how to do this but I have a call to a database which pulls the contents of a table into an array and I need a eregi string which will sift through the contents and put a line break (i.e. \n or <br>) after each ";", "}" or "{". here is what I have so far...function callback(&$value,$key) { $value = preg_replace('/([;{}])/',"$1\n",$value); }
while($b = mysql_fetch_array($sql)) {array_walk($b,'callback'); And then continue on as normal. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com