this works:
$xml_data = file('xml_edwr2.xml');
var_dump($xml_data); I can get the var_dump to work for 1 sample, but I guess there are a many samples in one xml file which turns into something like this(so, there is no way for me to reference a "column"):
array(9780) { [0]=> string(19) "
>>> "mike" <mike503@xxxxxxxxx> 10/26/2007 2:58:52 PM >>> On 10/26/07, John A DAVIS <John.A.Davis@xxxxxxxxxxx> wrote: > > > I've found simple examples on the web that work a simple XML file (song, > title, etc) but I need one that will parse an XML file into elements of an > array. And then, I need to reference these elements to validate against a > database. The data has to do with drinking water lab samples: use simplexml (php.net/simplexml) you may need to do string replacement though, replacing "EN:" with "EN_" or something; having ":" has proven to be complex for me in the past. $xml = file_get_contents('file.xml'); $xml = str_replace('EN:', 'EN_', $xml); $sxml = simplexml_load_string($xml); var_dump($sxml); that should be enough to get you started... enjoy! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php |