FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » pgsql and exception
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: pgsql and exception [message #178150 is a reply to message #178118] Tue, 15 May 2012 07:32 Go to previous messageGo to previous message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma:
Senior Member
Am 14.05.2012 15:26, schrieb Une Bévue:
> On 14/05/12 14:56, M. Strobel wrote:
>> how about substr()?
> right I'm testing that however I'm not sure it works with accentuated (UTF-8)
> characters.
>
> for example with :
> --- code ---------------------------------------------------------------
> <?php
> header('Content-Type:text/html; charset=utf-8');
>
> $str="Etre ou ne pas etre, telle est est la question.";
> echo $str."<br />";
> echo strlen($str)."<br />";
> echo substr($str, 0, 16)."<br />";
>
> $str="Être ou ne pas être, telle est est la question."; // Accentuated
> echo $str."<br />";
> echo strlen($str)."<br />";
> echo substr($str, 0, 16)."<br />";
>
> ?>
> ------------------------------------------------------------------------
>
> I get :
> Etre ou ne pas etre, telle est est la question.
> 47
> Etre ou ne pas e
> Être ou ne pas être, telle est est la question.
> 49
> Être ou ne pas
>

If you don't know the reason the accented version is longer, read about utf-8.

/Str.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:
Next Topic: Re: reading a newline from a properties file
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 04:15:09 GMT 2024

Total time taken to generate the page: 0.04148 seconds