www.webdeveloper.com
+ Reply to Thread
Results 1 to 4 of 4
  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
    225
    Hi,
    If it is only ’, try replace it directly:
    Code:
    $string = str_replace('’', "'", $string);
    Free resources, Courses and Tutorials for Web Programmers

  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
    225
    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.
    Free resources, Courses and Tutorials for Web Programmers

Thread Information

Users Browsing this Thread

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

     

Bookmarks

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