Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php xml eacute error

Tags:

php

xml

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) 
like image 469
nuclearmaker Avatar asked Jan 11 '10 11:01

nuclearmaker


2 Answers

&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.

like image 155
Greg Avatar answered Sep 30 '22 23:09

Greg


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.

like image 29
Rubens Farias Avatar answered Oct 01 '22 00:10

Rubens Farias