Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9270429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:22:04+00:00 2026-06-18T15:22:04+00:00

Hello here it is the problem: when i get to the $_POST latin string

  • 0

Hello here it is the problem:
when i get to the $_POST latin string strilen() works perfectly, but when i get cyrillic string strlen() doubles its value here is the code:

$word = $_POST['word'];
echo strlen($word) . '<br>'; //input: abc -> returns 3, input: абв -> returns 6 
var_dump($word); //input: abc -> returns string 'abc' (length=3), input: абв -> returns string 'абв' (length=6)

Do you have some ideas?!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:22:06+00:00Added an answer on June 18, 2026 at 3:22 pm

    strlen does not double anything, it simply reports what the situation is. Specifically, it reports how many bytes — and not how many characters — make up the string. That is because strlen does not have any knowledge of what a “character” is, and blindly assumes that 1 byte = 1 character. Therefore we say that “strlen is not multibyte-aware”.

    In your case, it seems that the browser submits UTF-8 encoded data to the server. In UTF-8, cyrillic is two bytes per character.

    If you want to find out the number of characters in the string, use the multibyte-aware mb_strlen:

    echo mb_strlen($word, 'UTF-8');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello again everyone, This time I have a problem with Intent & Extras. here's
Hello and here is my problem. All controllers return always 404 error in browser,
Hello there i'm having a problem here i have an add and edit form
Hello here is my problem I face for a while. I do not understand
Hello I have problem that I'm loosing $_POST['id'] value from select tag after clicking
Hello everybody, I have this problem (title of the post). Failure/Error: get :create, :user
Hello there im having a little problem here, i am trying to call a
Hello here is my script: ARGV.each do |input_filename| doc = Nokogiri::HTML(File.read(input_filename)) title, body =
SQL server 2008 Hello here is my query which returns the result SELECT *
Hello everyone here is my DAO class : public class UsersDAO extends HibernateDaoSupport {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.