Re: [PHP-DB] Re: Convert plain text to HTML tagged text
On Fri, 1 Oct 2004 23:33:46 -0400, GH [EMAIL PROTECTED] wrote: I have a question along this line... is it possible to have PHP do more than one str_replace at the same time? Have a look at the man page, it shows you how to use arrays to accomplish what you're trying to do. http://us2.php.net/str_replace -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Convert plain text to HTML tagged text
I think this should be posted somewhere else. Maybe the php-general list ?! This is no chemistry nor physics ! it's PHP-DB related issues right? no arrays or strings probs. Plz keep the consistancy of our good lists that are valuable for users who are us! On Mon, 4 Oct 2004 12:51:52 -0700, Andrew Kreps [EMAIL PROTECTED] wrote: On Fri, 1 Oct 2004 23:33:46 -0400, GH [EMAIL PROTECTED] wrote: I have a question along this line... is it possible to have PHP do more than one str_replace at the same time? Have a look at the man page, it shows you how to use arrays to accomplish what you're trying to do. http://us2.php.net/str_replace -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- M.Saleh.E.G 97150-4779817 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Convert plain text to HTML tagged text
just run them in order $test=str_replace(...); $test=str_replace(...); $test=str_replace(...); $test=str_replace(...); bastien From: GH [EMAIL PROTECTED] Reply-To: GH [EMAIL PROTECTED] To: Felipe Alcacibar [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Re: Convert plain text to HTML tagged text Date: Fri, 1 Oct 2004 23:33:46 -0400 I have a question along this line... is it possible to have PHP do more than one str_replace at the same time? or would I need to pass through each time seperately? I.e I wasn to check for Line returns and change it to p, i want to replace [c] with a special formating tag etc...? Thanks? On Wed, 29 Sep 2004 13:55:31 -0400, Felipe Alcacibar [EMAIL PROTECTED] wrote: if the returnns are \n you only need nl2br(this \n test \n)... or preg_replace(/((\r|\n)|(\r\n|\n\r))/, br /, this \r\n test \r\n)... good luck... [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] cast.net... To the list: I've googled and searched the manual, but I'm still looking for a simple solution to a simple problem. I have a MySQL database of text stories in longtext MySQL fields. These stories have simple returns (\r) in them and no other formatting. I need to use these stories both for web and print production, so I need to be able to get the text out of MySQL via PHP and have those returns change to P tags. But I also need to keep those extra P tags out of the database file so the text can be exported and poured into a layout program. HTMLspecialchars and HTMLentities don't seem like the right solution, but maybe I'm missing something. Do I have to use regular expressions in PHP as the text is pulled from the database? Thanks in advance for your help. --veditio -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Take advantage of powerful junk e-mail filters built on patented Microsoft® SmartScreen Technology. http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Convert plain text to HTML tagged text
I have a question along this line... is it possible to have PHP do more than one str_replace at the same time? or would I need to pass through each time seperately? I.e I wasn to check for Line returns and change it to p, i want to replace [c] with a special formating tag etc...? Thanks? On Wed, 29 Sep 2004 13:55:31 -0400, Felipe Alcacibar [EMAIL PROTECTED] wrote: if the returnns are \n you only need nl2br(this \n test \n)... or preg_replace(/((\r|\n)|(\r\n|\n\r))/, br /, this \r\n test \r\n)... good luck... [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] cast.net... To the list: I've googled and searched the manual, but I'm still looking for a simple solution to a simple problem. I have a MySQL database of text stories in longtext MySQL fields. These stories have simple returns (\r) in them and no other formatting. I need to use these stories both for web and print production, so I need to be able to get the text out of MySQL via PHP and have those returns change to P tags. But I also need to keep those extra P tags out of the database file so the text can be exported and poured into a layout program. HTMLspecialchars and HTMLentities don't seem like the right solution, but maybe I'm missing something. Do I have to use regular expressions in PHP as the text is pulled from the database? Thanks in advance for your help. --veditio -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php