Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
A bit of help is needed (Arrays)
Old 05-15-2008, 03:46 AM A bit of help is needed (Arrays)
Novice Talker

Posts: 14
Name: Dmitri
Trades: 0
I guess my task isn't so hard, but cannot consider that. Take a fresh look:

Here is an array:
HTML Code:
 Array
(
    [name] => Array
        (
            [0] => UFO
            [1] => UFO 2
            ...
            [n] => NameN
        )

    [author] => Array
        (
            [0] => Agent Fox Mulder
            [1] => Agent Dana Scully
            ...
            [n] => authorN
        )

    [year] => Array
        (
            [0] => 1994
            [1] => 1995
            ...
            [n] => yearN
        )
)
And need to transform to this:
HTML Code:
 Array (
    [0] => Array (name[0], author[0], year[0]),
    [1] => Array (name[1], author[1], year[1]),
    ...
    [n] => Array (name[n], author[n], year[n])
)
Thanks in advance.
Dknight is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-15-2008, 05:16 AM Re: A bit of help is needed (Arrays)
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
PHP Code:
$new_array = array():
foreach (
$source_array['name'] as $index=>$value) {
  
$new_array[$index] => array($source_array['name'][$index],$source_array['author'][$index],$source_array['year'][$index]);

__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Reply     « Reply to A bit of help is needed (Arrays)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.61680 seconds with 12 queries