Questions tagged as 'php-domdocument'

5
answers

How can I capture a favicon from a website via PHP?

I load an external content from a website and then import it into DOMDocument . I can currently capture information from the title tag easily. I do this: $dom = new DOMDocument(); @$dom->loadHtml('<?xml encoding="UTF-...
asked by 07.10.2015 / 15:11
2
answers

Change tag value of an XML

I'm having a hard time. I am not able to scan the XML file and change the values of the tags that I need, they are NOTA and SERIE . I have to replace these tags with new values, does anyone know how to do this? I researched, but the...
asked by 08.03.2017 / 19:40
2
answers

Capture div by class

I'm trying to capture a div from its class, but I did not succeed, note: I try to capture the div with the class class='m-definicao-conteudo' of the site that I report to curl, but I get this error:    Warning:   DOMDocument :: loadHT...
asked by 21.12.2014 / 05:03
0
answers

PHP syntax highlighter - DOM object does not update HTML

I've been developing a code to do syntax highlighting , but the code is failing to update the HTML. The code is extensive, and unfortunately all of it is needed. I have a main file named highlight.php : <?php final class highl...
asked by 18.05.2015 / 22:28
2
answers

Error "class DomDocument not found" when trying to run PHPUnit

When I try to run the command phpunit from the command line, I received the following error:    Class 'DOMDocument' not found This was not happening before. I remember having to remove and reinstall PHP. What can cause this erro...
asked by 23.02.2017 / 16:42
1
answer

How to define the output format of an XML in PHP?

Good afternoon! I'm developing a webservice in which I will not disclose the name in which there is a method that accepts XML in the following way: <exemplo> <exemplo></exemplo> <exemplo></exemplo> <...
asked by 05.09.2016 / 20:47
2
answers

json_encode returning "Malformed UTF-8 characters, possibly incorrectly encoded"

I'm using Laravel 3 on a particular system. Sometimes I'm having a problem with json_encode , which is returning false in some cases. In this code, I load an external page and, with DomDocument , I make a forea...
asked by 09.10.2015 / 14:36
3
answers

How to get only strings that contain the word "x"

I'm picking up through a PHP parser with DOM all the links on a page. I need to pick only the links that contain the word "buy-toyota" I was using the following code, but suddenly it stopped working: //array que pega o valor do parser $toyo...
asked by 19.10.2015 / 17:25
1
answer

ERROR = Warning: DOMDocument :: loadHTML (): Empty string supplied as input

Good morning, I have the following error:   Warning: DOMDocument :: loadHTML (): Empty string supplied as input. This error occurs on my free server, the strange thing is that locally everything works normal. Does anyone know why?...
asked by 17.09.2018 / 15:03
1
answer

Problems with file_get_contents and DOMDocument

I'm trying to download content from a website, but it's giving this warning:    'DOMDocument :: loadHTML (): Unexpected end tag: tr in Entity And it is indicating several lines. I can not fix the accent either. Could anyone help me und...
asked by 21.01.2016 / 13:04