www.webdeveloper.com
Results 1 to 4 of 4

Thread: Re converting html $rsquo; to xml acceptable character

  1. #1
    Join Date
    Apr 2012
    Posts
    4

    Re converting html $rsquo; to xml acceptable character

    Hi,
    I am getting SOAP ERROR:Encoding when i pass the html file soap function.I found that it is because of ’ is not acceptable by SOAP function.How to i convert html entity to xml..I have tried html_entity_decode,htmlspecialchars_decode,UTF*_decode.But nothing works for me..Pls suggest any other way

  2. #2
    Join Date
    Feb 2011
    Posts
    231
    Hi,
    If it is only ’, try replace it directly:
    Code:
    $string = str_replace('’', "'", $string);

  3. #3
    Join Date
    Apr 2012
    Posts
    4
    Hi MarPlo,
    Thanks for your reply.Like ’ there are many special characters which are not supported by xml..so I can not go with str_replace.Pls suggest any other solution..

    Thanks
    Ajarwe

  4. #4
    Join Date
    Feb 2011
    Posts
    231
    Hi,
    Last solution i suggest is to combine htmlspecialchars_decode() and str_replace(), like this:
    Code:
    $string = htmlspecialchars_decode(str_replace(array('’', '"'), array("'", '"'), $string));
    You can add also other characters to replace in arrays in str_replace(), in their order.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles