tags:

views:

198

answers:

4

hi,please help me here.i got this error

<Name>secret CAKES &amp; CAF&Eacute;
imited</Name>
XML Parsing Error: undefined entity
Location: http://localhost/xml.php

in my php

htmlentities($row['companys'],ENT_QUOTES) 
+1  A: 
Addsy
+1  A: 

Your XML file is invalid, as &Eacute; isn't a default character entity for XML documents.

You should to replace it by &#201; or to correctly encode it.

Rubens Farias
É gives a question mark
Ayrad
@Ayrad, you're probably using a page charset unavailable in your machine; Try ISO-8859-1 and/or take a look into this HTML entity reference: http://www.w3schools.com/tags/ref_entities.asp
Rubens Farias
+2  A: 

&Eacute; is a valid HTML entity, but not a valid XML entity (unless you define it).

Use htmlspecialchars instead.

Make sure your XML document defines the correct charset, too.

Greg
A: 

thanks, htmlspecialchars($row['companys'],ENT_QUOTES) will fix :)

nuclearmaker
Welcome to SO :) By the way, if an answer is good for you, you should "check it" and make it the accepted answer instead of adding another answer to reply. StackOverflow is not like a forum. Thanks.
Danny T.