Jumat, 04 Oktober 2013

PHP Indonesia - Facebook: bantu foreach utk nested array gan... :) ni arrayn...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Fun with Brazilian Portuguese

Learn the tips and tricks to speak colloquial Portuguese in a natural and confident manner. Enroll today for just $69!
From our sponsors
bantu foreach utk nested array gan... :) ni arrayn...
Oct 4th 2013, 12:03, by Muhammad Hendra

Muhammad Hendra 12:03pm Oct 4
bantu foreach utk nested array gan... :)
ni arraynya :

Array
(
[0] => Array
(
[id] => 6
[children] => Array
(
[0] => Array
(
[id] => 7
)

[1] => Array
(
[id] => 8
[children] => Array
(
[0] => Array
(
[id] => 9
)

)

)

[2] => Array
(
[id] => 11
)

)

)

[1] => Array
(
[id] => 10
)

)

coding ane.. ko pas menested foreachnya return : "illegal string offset" gimana ya solusinya ?
ato ada foreach yang lebih tepat...

ni foreach ane....
$ordering_post = $this->input->post("sortedList");
//print_r($ordering_post);

foreach ($ordering_post as $value) {




if(count($value > 1)){
foreach ($value as $value2 => $key) {

if(!is_array($key)){
echo $key;
}

echo $key['id'];


}

}
else {
echo $value['id']; echo "<br />\n";
}


}

thanks gan...

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar