1
I’m having a little trouble coming to that conclusion. I’ll exemplify, I have the fictional xml below:
<url>http://www.example.com/TITULO<url/>
I just want to change the title part, in case it stays that way:
<url>http://www.example.com/OUTROTITULO<url/>
Any idea how to make this change. I don’t want to change everything, just the part highlighted above.
Depends on a lot of things you didn’t report. Here are some (of the several) that make a difference: Is it always the same tag that the information will be exchanged? Is it just an exchange, or are there several? Is it always the same original string, or can it change? Look for as many details as possible, and preferably as close to the reality of the case. I suggest a read on [Ask] and [tour] for better use of the site.
– Bacco
And yet, it’s actually a string, or this XML has already gone through a parser?
– bfavaretto
a very fast and thick way is to use functions like strpos and/or explode and substr()... Another way is through regular expression, but partifularmente I prefer not to use ER for something very simple.
– Daniel Omine
There being no explicit restrictions, and not being necessary to interpret the structure of the XML file, I would use only the function preg_replace
– Delfino