NameSilo

[Php] Array Sorting

Spaceship Spaceship
Watch

liam_d

The original NP Emo KidEstablished Member
Impact
25
Okay please do bear with me this is hard to explain.

Firstly say i have these two arrays
Code:
Array
(
    [15] => Array
        (
            [0] => 18
            [1] => 15
        )

    [16] => Array
        (
            [0] => 17
            [1] => 19
            [2] => 16
        )

)

Array
(
    [18] => Array
        (
            [topic_id] => 1
            [forum_id] => 18
            [title] => sdfdsf
        )

)

And say i am currently doing a loop where lets say $id has gotten to "15". As you can see the first array with "15" has "15" and "18" in it.

The second array has "18".

What i want is to be able to pick that up, so then i can use the information like "title" and "topic_id".

Any help on how to do that would be great!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Maybe you want to explore Objects: PHP: Objects - Manual
Just pass a reference to an object in the array and have all the information you need inside.


Bruce
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back