Reply to Re: trim invisible chars

Your name:

Reply:


Posted by Koncept on 01/16/07 14:41

In article <45acc85d$0$297$426a74cc@news.free.fr>, severin
<severin.richard@free.fr> wrote:

> I'm searching a mysql syntax to do all thouses updates in one only
> query. Probably using regexp but i don't know how??


As far as I am aware, the regexp function in MySQL is only for string
comparison and does not work for substitutions. You will have to manage
this via PHP or string together a query with a ton of replace() to
handle all your replacements.

On the other hand, this is an example of how you can do it in PHP:

$str = "\t\r\ntest\ning\r123\r\n";
echo preg_replace( '/[\r\n \t]+/', "", $str );

--
Koncept <<
"The snake that cannot shed its skin perishes. So do the spirits who are
prevented from changing their opinions; they cease to be a spirit." -Nietzsche

[Back to original 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

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