Jump to content

Create an array from another array


LLeoun

Recommended Posts

Hi all,

 

This may be easy but it's been hours and I am not able to find the solution. Please help!

Here's my array:

 

Array
(
    [GetTagCloudResult] => Array
        (
            [TagCloud] => Array
                (
                    [0] => Array
                        (
                            [iD] => 10
                            [ChannelID] => 46
                            [PlaylistID] => 68
                            [searchWord] => sports
                            [searchQuantity] => 3
                        )

                    [1] => Array
                        (
                            [iD] => 11
                            [ChannelID] => 46
                            [PlaylistID] => 68
                            [searchWord] => beauty
                            [searchQuantity] => 3
                        )

                    [2] => Array
                        (
                            [iD] => 12
                            [ChannelID] => 46
                            [PlaylistID] => 68
                            [searchWord] => home
                            [searchQuantity] => 3
                        )

                    [3] => Array
                        (
                            [iD] => 13
                            [ChannelID] => 46
                            [PlaylistID] => 68
                            [searchWord] => recipes
                            [searchQuantity] => 3
                        )

                    [4] => Array
                        (
                            [iD] => 14
                            [ChannelID] => 46
                            [PlaylistID] => 68
                            [searchWord] => electronics
                            [searchQuantity] => 3
                        )

.
.

 

It goes like that until 33 elements. I need to create another array with just the first  four  elements ... How can I do that?

Thanks a ton!

Link to comment
https://forums.phpfreaks.com/topic/175233-create-an-array-from-another-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.