im trying parse following array data using foreach. cannot work. how can parse following array data message , xmlpath information?
here full code make question more informative. im trying validate xml , xsd schema using xmlvalidator. goal parse validation information have control on information validation produces.
$xml = note.xml; $schema = note.xsd; $ds = directory_separator; require_once(dirname(__file__).$ds.'xmlvalidator.php'); $validator = new xmlvalidator(); $result = $validator->validatexml($xml, $schema); $result['time'] = date("y-m-d h:i:s"); // here print_r of $result: echo '<pre>'; print_r($result); echo '<pre/>'; array ( [success] => [messages] => array ( ) [errors] => array ( [0] => libxmlerror object ( [level] => 1 [code] => 1549 [column] => 0 [message] => failed load external entity "/var/www/html/pdf/notexml" [file] => [line] => 0 ) ) [xmlpath] => notexml [mainschemapath] => notexsd [time] => 2015-04-27 23:22:29 )
looking php foreach function. can this:
foreach($array $arr){ $xmlpath = $arr['xmlpath']; }