You are here: Re: An Easy One for you all « All PHP « IT news, forums, messages
Re: An Easy One for you all

Posted by J.O. Aho on 04/07/07 15:56

MS wrote:
> Im sure this must be quite easy to accomplish but I can not find the
> function/way to do it.
>
> MySQL Database field is saved as....
>
> "this is the text
>
> and has line breaks
>
> like this"
>
> Now I want to concat each line into a variable like this.
>
> "this is the text and has line breaks like this"
>
> I have tried trim() which supposedly takes out whitespace but its not
> working as I expect.

trim removes whitespace before the first none-whitespace character in a
string, and all the whitespace after the last none-whitespace character in the
same string.

if you trim this string " a z ", you get "a z", you can have what ever kind
of whitespace charactes between a and z without them being removed.


> What do I have to do?

In this case eregi_replace could work, replace "\n" with a " " and you should
get one line. http://www.php.net/manual/en/function.eregi-replace.php

--

//Aho

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация