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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:42:44+00:00 2026-05-14T15:42:44+00:00

I have some xml files with figure spaces in it, I need to remove

  • 0

I have some xml files with figure spaces in it, I need to remove those with php.
The utf-8 code for these is e2 80 a9. If I’m not mistaken php does not seem to like 6 byte utf-8 chars, so far at least I’m unable to find a way to delete the figure spaces with functions like preg_replace.

Anybody any tips or even better a solution to this problem?

  • 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-14T15:42:45+00:00Added an answer on May 14, 2026 at 3:42 pm

    Have you tried preg_replace('/\x{2007}/u', '', $stringWithFigureSpaces);?

    U+2007 is the unicode codepoint for the FIGURE SPACE.

    Please see my answer on a similar unicode-regex topic with PHP which includes information about the \x{FFFF}-syntax.

    Regarding you comment about the non-working – the following works perfectly on my machine:

    $ php -a
    Interactive shell
    
    php > $str = "a\xe2\x80\x87b";  // \xe2\x80\x87 is the FIGURE SPACE
    php > echo preg_replace('/\x{2007}/u', '_', $str); // \x{2007} is the PCRE unicode codepoint notation for the U+2007 codepoint
    a_b
    

    What’s you PHP version? Are you sure the character is a FIGURE SPACE at all? Can you run the following snippet on your string?

    for ($i = 0; $i < strlen($str); $i++) {
        printf('%x ', ord($str[$i]));
    }
    

    On my test string this outputs

    61 e2 80 87 62
    a  |U+2007|  b
    

    EDIT after OP comment:

    \xe2\x80\xa9 is a PARAGRAPH SEPARATOR which is unicode codepoint U+2029, so your code should be preg_replace('/\x{2029}/u', '', $stringWithUglyCharacter);

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

Sidebar

Related Questions

I have some XML files of this form: <?xml version=1.0 encoding=utf-8?> <?xml-stylesheet type=text/xsl href=biomirror.xsl?>
I have some XML code that looks like this <SEARCHRESULTS> <FUNCTION name=BarGraph> <PARAMETER name=numList></PARAMETER>
I'm not even sure if it's possible but say I have some XML: <source>
I have a file which is an XML representation of some data that is
I have some XML in an XmlDocument, and I want to display it on
i have some xml with math ml inside, and i would like to find
So I have some XML in the following format: <somenode> <html xmlns=http://www.w3.org/1999/xhtml> <head> <title/>
Let's say I have some XML like this <channel> <item> <title>This is title 1</title>
Greetings! I have some XML like this: <Root> <AlphaSection> . . . </AlphaSection> <BetaSection>
Greetings! I have some XML like this: <Root> <MainSection> <SomeNode>Some Node Value</SomeNode> <SomeOtherNode>Some Other

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.