Skip to content
Advertisement

Tag: xml

How to search in XML? (PHP)

I am working on a word application. I’m trying to get values from XML. My goal is getting the first and last letter of a word. Could you help me, please? PHP code: Answer The letter is in an attribute named ‘category’. Or in SimpleXML

Convert m3u8 playlist files to XML list [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 6 months ago. Improve this question I was wondering if there is any way to convert an

Create array from xml more objects with same name

Is there a way to create an array from xml file that will contain all of the <IMG_ALTERNATIVE> values so I can use them in my other function? The xml looks like this: I parse the xml this way in php: Answer use this code https://3v4l.org/0igDF

convert string to xml in PHP

When I use simplexml_load_file from a webservice, it returns But, I cannot parse it as XML to get the attributes. I need it to be formatted as such: and then this code works: I tried str_replace and decoding, without success. Answer The contents of the “string” element is an XML document itself – stored in an text node. You can

Accessing attribute from xml string in php

I have a php application and I am trying to echo a atrribute from the xml. Here is the xml: This is what I have tried till now: But it gives me this errors: Can someone give me an example to extract from the xml from the beginning of the post the index ? Thanks in advance. I am a

PHP showing XML calendar data – merge day events

I have the following XML file, which I can’t edit. I am then outputting this using simplexml_load_file($url) into a PHP file: This gives me an output as follows: However, I would like to merge events by date, so the output would be as follows: How can I achieve this without editing the XML file? Thanks! Answer Since you are dealing

Laravel DOMDocument : failed to open stream: Permission denied

I’m trying to generate xml file in Laravel, I use DOMdocument but I got this error message when I try to save the file : Code in blade file : I know it’s something with permission but i’m not sure where to change the permission and for what. Thank you for help in advance. Answer Seems you need to provide

How can I rewrite this xml file with the correct encoding using php?

I want to rewrite an xml file without the encoded characters using php. My xml file looks like this: How can I fix the issue with the encoded characters? Is there any way I could use php to rewrite the file? thanks. EDIT: This Is my code that takes an xml file, and then splits it into piecies based on

Advertisement