Does anyone know why the following isn't working, I'm losing my mind over this.
[PHP]
//if this is part of the xml file your loading
$str = '<xmlRoot>
<sample id="1">
<Company>GSK</Company>
<JPG_400>1gskmi sc_400.jpg</JPG_400>
</sample>
<sample id="2">
<Company>GSK</Company>
<JPG_725>1gskmi sc_725.jpg</JPG_725>
</sample>
</xmlroot>';
//this dosn't match the first node only
preg_match('/<sample id\="1">[\S\s]*<\/sample>/',$str,$a);
print_r($a[0]);
[/PHP]
[PHP]
//if this is part of the xml file your loading
$str = '<xmlRoot>
<sample id="1">
<Company>GSK</Company>
<JPG_400>1gskmi sc_400.jpg</JPG_400>
</sample>
<sample id="2">
<Company>GSK</Company>
<JPG_725>1gskmi sc_725.jpg</JPG_725>
</sample>
</xmlroot>';
//this dosn't match the first node only
preg_match('/<sample id\="1">[\S\s]*<\/sample>/',$str,$a);
print_r($a[0]);
[/PHP]
Comment