I am doing this tutorial but with a diferent xml http://blog.insicdesigns.com/2009/03/parsing-xml-file-using-codeigniters-simplexml-library/, but I keep getting the same error: A PHP Error was encountered Severity: Notice Message: Undefined variable: myxml Filename: controllers/welcome.php Line Number: 45
Bu benim mi kodu: Ben dizin C xml dosya koymak: \ Users \ beto \ Documents \ xml \ myxml.xml, ama bana yardım ya da nasıl düzeltebilirim bana söyleyebilir ben yanlış düşünüyorum?
function _getXML($fname)
{
$filename = $fname.’.xml’;
$xmlfile=“C:\\Users\\beto\\Documents\\xml”.$filename;
**$xmlRaw = file_get_contents($xmlfile);**ERROR
$this->load->library(‘simplexml’);
$xmlData = $this->simplexml->xml_parse($xmlRaw);
foreach($xmlData[‘Emisor’] as $row)
{
$result .= ‘<tr>’;
$result .= ‘<td>’.$row[‘id’].’</td>’;
$result .= ‘<td>’.$row[‘name’].’</td>’;
$result .= ‘<td>’.$row[‘category’].’</td>’;
$result .= ‘<td>$ ‘.$row[‘price’].’</td>’;
$result .= ‘</tr>’;
}
return $result;
}