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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:06:05+00:00 2026-06-12T11:06:05+00:00

I have a Greek text and I want to convert it to Hexadecimal code

  • 0

I have a Greek text and I want to convert it to Hexadecimal code points without spaces. Just one big string of text.

This was exactly what I was looking for -> Unicode Hexadecimal code points for PHP but it doesn’t provide the actual code how he did it.

  • 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-12T11:06:06+00:00Added an answer on June 12, 2026 at 11:06 am

    Based on the original code and the answer to this question: How to get code point number for a given character in a utf-8 string? I put together this function:

    function utf8_to_unicode($str) {
    
        $unicode = array();        
        $values = array();
        $lookingFor = 1;
    
        for ($i = 0; $i < strlen($str); $i++) {
    
            $thisValue = ord($str[$i]);
    
            if ($thisValue < 128) 
                $unicode[] = str_pad(dechex($thisValue), 4, "0", STR_PAD_LEFT);
            else {
                if (count($values) == 0) $lookingFor = ($thisValue < 224) ? 2 : 3;                
                $values[] = $thisValue;                
                if (count($values) == $lookingFor) {
                    $number = ($lookingFor == 3) ?
                    (($values[0] % 16) * 4096) + (($values[1] % 64) * 64) + ($values[2] % 64):
                    (($values[0] % 32) * 64) + ($values[1] % 64);
                    $number = strtoupper(dechex($number));
                    $unicode[] = str_pad($number, 4, "0", STR_PAD_LEFT);
                    $values = array();
                    $lookingFor = 1;
                } // if
            } // if
        } // for
        return ($unicode);   
    } // utf8_to_unicode
    

    So:

    $greekString = "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ ";
    $hexArray = utf8_to_unicode($greekString);
    echo implode("", $hexArray);
    

    Will output:

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

Sidebar

Related Questions

I have this following code and i want to display images and other html
I have a progress dialog and I want to display text message like below
I want to have such text on hover on green yellow or blue selection.I
I have the following piece of code: decimal kwh = decimal.Parse(textBox1.Text, NumberStyles.AllowDecimalPoint, NumberFormatInfo.CurrentInfo); decimal
I have a problem, I want to grab text and execute text as PHP,
I have text stored in a variable which contains several span tags. I want
I have a table of one row with two columns.I want to align content
i want to get text as spanned in order to have the html view
xxxi have the_title() that returns some text, in this case Blue &#038; Whiny the
I have two layouts(xml files) and I want to flip from one page to

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.