Category : dom

I’m trying to remove span tags with a specific style (preserving the text) but don’t understand why the result is putting span text inside the first span in this example? $curr_notes = ‘<span style="color: rgb(226, 80, 65);"><br></span><span style="color: rgb(0, 0, 0);">TEXT 1</span><br><span style="color: rgb(0, 0, 0);">TEXT2</span>’; $pattern = ‘//span[@style="color: rgb(0, 0, 0);"]’; $dom = new ..

Read more

I’m trying to modify a 130mb+ XML file via PHP so it only shows the results where a child node is a specific value. I’m trying to filter this because of limitations via the software we’re using to import the XML into our website. Example: (mockup data) <Items> <Item> <Barcode>…</Barcode> <BrandCode>…</BrandCode> <Title>…</Title> <Content>…</Content> <ShowOnWebsite>false</BrandDescr> </Item> ..

Read more