Skip to content
Advertisement

converted to when using PHP DOMDocument

I’ve the following HTML code with a custom tag <gcse:search>. It’s from “Custom Google Search Engine” to embed in a page.

However, after parsing via PHP DOMDocument, <gcse:search> gets converted to <search> breaking the functionality.

JavaScript

Output:

JavaScript

Advertisement

Answer

The only solution I found is to replace : with ___ and then replace back after saveHTML().

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement