You are here: Re: char replacement « PHP Programming Language « IT news, forums, messages
Re: char replacement

Posted by VooDoo on 11/04/05 12:02

It works! thanks a lot for your answer!
cya
VooDoo
"Ewoud Dronkert" <firstname@lastname.net.invalid> a ιcrit dans le message de
news: sakjm11q842meqee2opin3krs6lrb5bn1o@4ax.com...
> VooDoo wrote:
>> How can i do an update on this table to replace only the characters
>> 'ι' or 'θ' by a 'e'.
>
> In PHP:
>
> $subject = 'somι linθ';
> $search = 'ιθ';
> $replace = 'ee';
> $updated = strtr($subject, $search, $replace);
>
> or
>
> $subject = 'somι linθ';
> $search = array('ι', 'θ');
> $replace = 'e';
> $updated = str_replace($search, $replace, $subject);
>
> But I guess you need a SQL query ("table with a field"). Better ask in
> comp.databases.mysql or have a look at
> http://dev.mysql.com/doc/refman/4.1/en/string-functions.html It might be
>
> UPDATE t1 set f1 = REPLACE(REPLACE(f1, 'θ', 'e'), 'ι', 'e')
>
> --
> E. Dronkert

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация