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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:44:31+00:00 2026-05-30T04:44:31+00:00

I am using PHP to generate some XML. I need to put quotes in

  • 0

I am using PHP to generate some XML. I need to put quotes in some of the text that is sent. I can use htmlentities or htmlspecialchars() to convert the quotes to special characters and the special characters display fine in Firefox or Chrome. However, in Internet Explorer it just creates a blank item.

In Firefox it writes:

<marker description="Yes &quot;I Do"/>

In IE it writes:

<marker description=""\>

Here’s the pertinent code:

$dom = new DOMDocument("1.0");
$node = $dom->createElement("markers");
$parnode = $dom->appendChild($node);
header("Content-type: text/xml");

$node = $dom->createElement("marker");
$newnode->setAttribute("description", htmlentities("Yes \"I Do"))
echo $dom->saveXML();

Sorry, I have been trying to debug everything and I posted the wrong text. I have been using htmlspecialchars() as the change notes it still does not work. I tried the &quot as a test and it works in Firefox but not IE. Sorry for the original typo. – user1098504 14 hours ago

As a test, put “Yes "I Do” in anyway, and see if IE is still broken. – SpikeX 14 hours ago

I have it working now. I had been trying the htmlspecialchars() and tried the &quot as a test. I think somewhere when I was testing I did not clear the cache every time with IE and even though I was doing a force refresh it was not always refreshing. I think part of my original problem was someone copied and pasted the original data into the form and ended up with angle quotes. Any ideas for converting these? Thanks for again for your help with my problem even though I think it was a refresh error.

  • 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-30T04:44:32+00:00Added an answer on May 30, 2026 at 4:44 am

    You need to change this line:

    $newnode->setAttribute("description", "Yes "I Do");
    

    To this:

    $newnode->setAttribute("description", "Yes &quot;I Do");
    

    You can use htmlspecialchars() to achieve the same thing, if you don’t want to do each entity by hand.

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

Sidebar

Related Questions

Using PHP, what are some ways to generate a random confirmation code that can
I have a PHP script that I am using to generate some rather complicated
I have a script that generates images from text using PHP. It's working fine
I'm trying to wrtie a facebook application that generates random quotes using php. However,
i want using php generate a pdf in my site with some format and
I have a PHP application that needs to generate some PDF invoices and PDF
Here is a JavaScript that I use to generate some countdowns, my problem is
I'm using PHP to generate a Javascript button that adds in a checkbox and
I'm writing some XML in PHP that is not validating because the closing greater
I'm using PHP to generate some HTML, <?php $news = NewsDat(); foreach($news as $single_new)

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.