Thrasos Website

Sometimes I write about tech and code, and sometimes I don't.

Menu
  • Home
  • About
Menu

Never ever…

Posted on February 29, 2012June 14, 2013 by thrasos

…forget that every Greek character is  counted as 2  by the strlen function in PHP. So if you have say a string “Γειά” the strlen will return 8.

Try using MB_STRLEN() instead. If you know the encoding you can save time.

mb_strlen ( string $str [, string $encoding ] )

 

 

Category: blog, code

Post navigation

← Desk@work
Temptation →

You can say something here... Cancel reply

  • GitHub
  • LinkedIn
  • Twitter
  • Telegram
  • Cleaning up VCARD contacts without a phone.January 29, 2023
  • Docker Compose Notes #2December 15, 2022
  • Docker Notes #1December 14, 2022
  • A.I generated poem in GreekDecember 11, 2022
  • A.I. Generated ArtDecember 10, 2022
  • A.I. generated art.December 9, 2022
  • MailCow, simple html in maindomainSeptember 10, 2022
  • CamouflageFebruary 1, 2022
  • Kerkhoffs principleNovember 16, 2020
  • ASCII ARTAugust 13, 2020
© 2023 Thrasos Website