Exemple HTML
<html><body><table>
<tr><td><div>12{X]</div></td></tr>
<tr><td><div>13{D}</div></td></tr>
</table></body></html>
running:
$dom = str_get_html($exemple);
$res = $dom->find("td/div", 0);
var_dump($res->plaintext);
result:
string(55) "12{X]</div></td></tr> <tr><td><div>13{D}"
remove '{' in 1st div
or '}' in 2nd div
or replace ']' to '}' in 1st div
<html><body><table>
<tr><td><div>[12X]</div></td></tr>
<tr><td><div>13{D}</div></td></tr>
</table></body></html>
and result will be ok
string(4) "[12X]"
Same with the bug I found https://sourceforge.net/p/simplehtmldom/bugs/154/
Do you solve it ?
This support form is dead. We must solve it by ourselves.
Hi,
I have the same problem and find a solution.
I put in the following code in the file "simple_html_dom.php" in the "protected function prepare" after "$this->original_size = $this->size;"
$str = str_replace("{", "{", $str);
$str = str_replace("}", "}", $str);
It's a little bit ugly, but it works.
thank you very much.
[e60ffe] was recently added to master, which solves your issue (same as #154). Please let me know if you experience futher problems.
Related
Commit: [e60ffe]