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 1091889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:36:08+00:00 2026-05-16T23:36:08+00:00

Good Evening folks. This is my code: static private function removeAccentedLetters($input){ for ($i =

  • 0

Good Evening folks.

This is my code:

static private  function removeAccentedLetters($input){
    for ($i = 0; $i < strlen($input); $i++) {
        $input[$i]=self::simplify($input[$i]);
    }
    return $input;
}
static private function simplify($in){
    $ord=ord($in);
    switch ($ord) {
        case 193: //Á...
        return 'A';
        case 98: //b
        return 'a';
        default:
        return $in;
    }
}

Ok. This is the bit that doesn’t work

case 193: //Á...
  return 'A';

And this is the bit that does:

case 98: //b
return 'a';

These are just for testing purposes.

Could anyone tell me what’s happening? I had the same sort of error before but now I’m not using any extended ASCII in the code itself, which was the cause of error before.

I’m thinking it must have something to do with character encoding but I’m not sure. By the way, I’m coding in Eclipse and, according to it, the character encoding I’m using is Cp1252.

Oh, and yes, the code is supposed to eliminate any accented Letters such as á à and replace them with their basic vogals, i.e. á->a

Thanks in advance

  • 1 1 Answer
  • 1 View
  • 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-05-16T23:36:08+00:00Added an answer on May 16, 2026 at 11:36 pm

    Could it be that if you have multi byte characters, and you are looping through each character using strlen() to check if you have looped through? strlen() assumes 1 byte == 1 character.

    I’d look into existing transliteration libraries for PHP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good evening, I'm having an issue with Masonry. This is all my relevant code:
Good evening :-)! I have this code to use Drag & Drop method for
Good evening. This code works. It sorts an array of cards by both Suit
Good evening. For a project, I have to create a system. In this system,
Good evening fellow coders, and thank you in advance for any help/attention. This is
Good evening StackOverflow This time I'm fighting with a ListView Containing TextViews. I add
Good evening, I made a well working function with php, mysql and ajax. A
Good Evening, I'm building a website which will will look something like this: So
Good evening, I am tired and have been fighting with this for hours. I
Good evening, Following is the code I used for reading the files and folders

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.