php - Twitter API simplexml_load_string stop working -


this morning php script, twitter oauth posting, stopped working. suspect twitter added rows returned string. can how debug this.

thanks

warning:  simplexml_load_string() [function.simplexml-load-string]: entity: line 74:  parser error : entity 'copy' not defined in /nfs/c05/h01/mnt/82363/domains/html/c/cron.m.php on line 429  warning:  simplexml_load_string() [function.simplexml-load-string]:            <li class="first">&copy; 2011 twitter</li> in /nfs/c05/h01/mnt/82363/domains/html/c/cron.m.php on line 429  warning:  simplexml_load_string() [function.simplexml-load-string]: ^ in /nfs/c05/h01/mnt/82363/domains/html/c/cron.m.php on line 429 

the xml contains html entities. &copy; not valid in xml. workaround pre-filter document before handing on simplexml:

$xml = file_get_contents(...); $xml = strtr($xml, array_flip(array_diff(            get_html_translation_table(html_entities),            get_html_translation_table(html_specialchars)        )));  $xml = simplexml_load_string($xml); 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -