Llevo días sin saber como hacerlo..
![Neurótico](http://static.forosdelweb.com/fdwtheme/images/smilies/scared.png)
al imprimir el array con var_dump($array)
es así:
Código PHP:
array(7) {
["category_id"]=>
string(1) "1"
["parent_id"]=>
string(1) "0"
["name"]=>
string(4) "Root"
["is_active"]=>
string(1) "1"
["position"]=>
string(1) "1"
["level"]=>
string(1) "0"
["children"]=>
array(2) {
[0]=>
array(7) {
["category_id"]=>
string(1) "3"
["parent_id"]=>
string(1) "1"
["name"]=>
string(12) "Root Catalog"
["is_active"]=>
string(1) "1"
["position"]=>
string(1) "3"
["level"]=>
string(1) "1"
["children"]=>
array(4) {
[0]=>
array(7) {
["category_id"]=>
string(2) "10"
["parent_id"]=>
string(1) "3"
["name"]=>
string(9) "Furniture"
["is_active"]=>
string(1) "1"
["position"]=>
string(2) "10"
["level"]=>
string(1) "2"
["children"]=>
array(2) {
[0]=>
array(7) {
["category_id"]=>
string(2) "22"
["parent_id"]=>
string(2) "10"
["name"]=>
string(11) "Living Room"
["is_active"]=>
string(1) "1"
["position"]=>
string(2) "22"
["level"]=>
string(1) "3"
["children"]=>
array(0) { ..... etc (es largo)
función recursiva que uso para recorrerlo:
Código PHP:
function recorrer_array($array){
foreach($array as $indice => $valor){
if (is_array($valor)){
recorrer_array($valor);
}
como ingreso los datos del array a la base de datos????
Muchas gracias.