I'm working on storing result of xml feed into database... I'm able to load file... but when I want to store data into array, it stores instead of value ([title] = 'Klapka 120mm';
) this:
[title] => SimpleXMLElement Object ( [0] => Klapka 120mm )
Do you know, where might be problem?
Source code:
Here is part of one function:
$import_file = simplexml_load_file($this->input->post('import_url')); // load file from url
$affected_products = 0;
foreach($import_file->SHOPITEM as $product) {
$affected_products += $this->import_product($product);
}
Here is first part of function import_product:
public function import_product($product)
{
/* save product data into array */
$data = array(
'title' => $product->PRODUCT,
'content' => $product->DESCRIPTION,
'price' => $product->PRICE,
'price_vat' => $product->PRICE_VAT,
'ean' => $product->EAN,
'count' => $product->AVAILABILITY
);
die(print_r($data));
Thank you very much for your replies