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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:07:18+00:00 2026-05-19T12:07:18+00:00

Follow up on this post I made earlier on. I found out XML actually

  • 0

Follow up on this post I made earlier on.

I found out XML actually takes numeric codes instead of name codes when dealing with special characters. So I have looked through online on how to convert special characters into numberic codes, but I haven’t got any lucks.

Do I have to write a function to do this task or does php come with any default function which can save up lots of works?

For instance, I want to convert á to á but not á to á

Is it possible?

Please help if you have any ideas.

EDIT:

I am using this suggestion to convert the special chars into numberic chars,

$txt = preg_replace('/([\x80-\xff])/e', "'&#' . ord('$1') . ';'", $txt);

but I just found out that it does not convert these 5 special chars into numberic codes – <, >, &, ' and ".

How can I get around them?

Thanks.

  • 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-05-19T12:07:19+00:00Added an answer on May 19, 2026 at 12:07 pm

    The generic approach is to use:

    $txt = preg_replace('/([\x80-\xff])/e', "'&#' . ord('$1') . ';'", $txt);
    

    You must ensure that $txt does indeed contain Latin-1 already (utf8_decode), because you’d otherwise receive the wrong value from the string byte.

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

Sidebar

Related Questions

I am tring to follow this post post and combine it with the ShootThemUp
This is a follow up of this [post] Ada: Adding an exception in a
This post if a follow-up question to mt previous post: Android RESTful Web application
I'm trying to follow this tutorial using StructureMap : http://iridescence.no/post/Constructor-Injection-for-ASPNET-MVC-Action-Filters.aspx What I'm trying to
This is a follow-up question related to my previous post . Below is a
I'm trying to follow this blog post: http://blogs.msdn.com/b/carlosfigueira/archive/2011/04/19/wcf-extensibility-message-inspectors.aspx My aim is to somehow get
This is a follow up on a previous unsolved post. I have a navcontroller,
I made a post about this yesterday, but it is a fairly different question.
I follow this tutorial online exactly but somehow it's giving me errors. Saying there
I follow this rule but some of my colleagues disagree with it and argue

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.