1
I need to get the values ( $src ), inside this foreach, of each key separately in this array:
<?php
foreach( get_post_gallery( $post->id, false ) as $key => $src ) {
echo $key; //resultado: link, size - ids - src
echo $src; //resultado: file, full - 61,59,57,41 - Array
}
?>
This is the full array on var_dump();
<?php
array(4) {
["link"]=> string(4) "file"
["size"]=> string(4) "full"
["ids"]=> string(11) "61,59,57,41"
["src"]=> array(4) {
[0]=> string(83) "http://localhost/1.jpg"
[1]=> string(94) "http://localhost/2.jpg"
[2]=> string(62) "http://localhost/3.jpg"
[3]=> string(68) "http://localhost/4.jpg"
}
}
?>
UPDATE
I wish I could assemble the result like this:
<?php
array(4) {
["link"]=> string(4) "file"
["size"]=> string(4) "full"
["ids"]=> array(4) {
[0]=> string(83) "61"
[1]=> string(94) "59"
[2]=> string(62) "57"
[3]=> string(68) "41"
}
["src"]=> array(4) {
[0]=> string(83) "http://localhost/1.jpg"
[1]=> string(94) "http://localhost/2.jpg"
[2]=> string(62) "http://localhost/3.jpg"
[3]=> string(68) "http://localhost/4.jpg"
}
}
?>
Some charitable soul could help?
– Lollipop
You can make a new foreach() inside src
– Sr. André Baill