1
I have a string, similar to an XML document:
<lists>
<list name='NOVOS' values='1'>
<list name='OLDS' values='2'>
</lists>
What I need to do is scan this code, and create an array with the name of the list.
Getting, for example, the return of it: 0 -> NEW and 1 -> OLDS and so on.
I tried to:
preg_match( '/name="([^"]*)"/i', $s, $lists_return );
Sometimes it works and sometimes returns only the first item in the list. The variable s
is where the string I entered above is. It can be in regular expression.
"similar to a Document XML". It is an xml or not, because in the title is "Search XML tags", so it would be easy to help.
– Mauro Alexandre
It is not XML, it is just a string, in the format I indicated. If it were XML I could use several examples, but the format is the one quoted in the question:
– Luhhh
<lists> <list name='NEW' values='1'> <list name='OLDS' values='2'> </lists>
– Luhhh