-2
I am developing a tool that collects from a string only the ID fields and the name. However I do not know how to do this in php follows below the string.
<s:Label x="10" y="10" text="NOME"/>
<s:TextInput id="NOME" x="10" y="21" width="290" tabIndex="1"/>
<s:Label x="10" y="50" text="TELEFONE"/>
<s:Label x="120" y="50" text="RAMAL"/>
<s:TextInput id="RAMAL" x="120" y="61" width="102" tabIndex="5"/>
<s:Label x="365" y="50" text="LOGIN"/>
<s:TextInput id="LOGIN1" x="365" y="61" width="102" tabIndex="7"/>
<s:TextInput id="TELEFONE" x="10" y="61" width="102" tabIndex="4"/>
<s:Label x="308" y="11" text="EMAIL"/>
<s:TextInput id="EMAIL" x="308" y="22" width="290" tabIndex="2"/>
<s:Label x="605" y="10" text="MATRICULA"/>
<s:TextInput id="MATRICULA" x="606" y="22" width="144" tabIndex="3"/>
<s:Label x="627" y="91" text="NASCIMENTO"/>
<s:TextInput id="NASCIMENTO" x="627" y="103" width="121" tabIndex="14"/>
Note that in each object except the label there is a precise ID to pick up the contents inside the simple quotes example: id="NAME"
How to do this? Remembering that this string can be gigantic
This is all a string, with line breaking and everything?
– Sam
Yeah, and I just need to get the contents of the Ids
– Eduardo
I believe that a
preg_match_all('/id="(.+?)"/', $str, $matches); var_dump($matches[1]);
resolves. The variable$str
is where the string is stored.– Sam
Boy you’re a genius That’s right
– Eduardo