Jump to content

Some array help


KingOfHeart

Recommended Posts

print_r($lmem);
print_r($online);
print_r($birth);

 

OutPut...

Array ( [id] => 13610 [name] => enormantuckere [href] => http://www.thegaminguniverse.com/forum/index.php?action=profile;u=13610 [link] => enormantuckere ) Array ( [users] => Array ( [2010-11-04 22:59:11Guardian] => Array ( [id] => 264 [username] => Guardian [name] => Guardian [group] => 11 [href] => http://www.thegaminguniverse.com/forum/index.php?action=profile;u=264 [link] => Guardian [hidden] => [is_last] => 1 ) ) [guests] => 5 [hidden] => 1 [buddies] => 0 [num_users] => 2 [total_users] => 7 ) Array ( [0] => Array ( [id] => 148 [name] => Knuckles [age] => 24 [is_last] => [is_today] => 1 ) [1] => Array ( [id] => 12290 [name] => xgmx [age] => 18 [is_last] => 1 [is_today] => 1 ) )

 

How do I check to see if there's a user in the $online list that matches $lmem ?

How do I check to see if there's a user in the $online list that matches $birth ?

 

I only want to check username arrays but I'm not sure how to do that even.

I got some more questions but I'll wait until I can get some answers. I have no control over this array (no authority), I just output it.

Link to comment
https://forums.phpfreaks.com/topic/217812-some-array-help/
Share on other sites

Array
(
    [id] => 13610
    [name] => enormantuckere
    [href] => http://www.thegaminguniverse.com/forum/index.php?action=profile;u=13610
    [link] => enormantuckere
)

Array
(
    [users] => Array
        (
            [2010-11-06 16:20:52Janus] => Array
                (
                    [id] => 420
                    [username] => Janus
                    [name] => Janus
                    [group] => 1
                    [href] => http://www.thegaminguniverse.com/forum/index.php?action=profile;u=420
                    [link] => Janus
                    [hidden] => 
                    [is_last] => 
                )

            [2010-11-06 16:20:02Guardian] => Array
                (
                    [id] => 264
                    [username] => Guardian
                    [name] => Guardian
                    [group] => 11
                    [href] => http://www.thegaminguniverse.com/forum/index.php?action=profile;u=264
                    [link] => Guardian
                    [hidden] => 
                    [is_last] => 
                )

            [2010-11-06 16:14:00Rowan] => Array
                (
                    [id] => 93
                    [username] => Rowan
                    [name] => Rowan
                    [group] => 1
                    [href] => http://www.thegaminguniverse.com/forum/index.php?action=profile;u=93
                    [link] => Rowan
                    [hidden] => 
                    [is_last] => 1
                )

        )

    [guests] => 18
    [hidden] => 1
    [buddies] => 0
    [num_users] => 4
    [total_users] => 22
)

Array
(
    [0] => Array
        (
            [id] => 534
            [name] => Aleksey
            [age] => 21
            [is_last] => 
            [is_today] => 1
        )

    [1] => Array
        (
            [id] => 2015
            [name] => The_Dark_Man
            [age] => 20
            [is_last] => 
            [is_today] => 1
        )

    [2] => Array
        (
            [id] => 2003
            [name] => Layer 01
            [age] => 25
            [is_last] => 
            [is_today] => 1
        )

    [3] => Array
        (
            [id] => 2981
            [name] => Dustbin
            [age] => 20
            [is_last] => 
            [is_today] => 1
        )

    [4] => Array
        (
            [id] => 5942
            [name] => Ryu Hayabusa
            [age] => 21
            [is_last] => 1
            [is_today] => 1
        )

)

 

Helps a bit.

 

So that means one of the $online array would look like this?

$online['users'][2010-11-06 16:20:52Janus][username]

 

Since I only need the username array that might make things a little tricky.

Link to comment
https://forums.phpfreaks.com/topic/217812-some-array-help/#findComment-1131156
Share on other sites

Well I managed to get all the information for birth into an array, and users into another array.

How do I search two arrays and see if there are any matches between them?

 

It would probably a lot easier just to run a comparison query directly on your tables.

Link to comment
https://forums.phpfreaks.com/topic/217812-some-array-help/#findComment-1132893
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.