PHP: / sıralama boyutta bir anahtar dayalı çok boyutlu bir dizi birleştirmek için Need

0 Cevap php

Ben yapmak ne çalışıyorum açıklamak mümkün olacağını umuyoruz - ve gerçekten birileri yardımcı olacağını umuyoruz! İşte ben çalışıyorum dizidir

(
    [0] => Array
        (
            [city] => Middletown
            [state] => OH
            [freq] => 146.610
            [pl] => 77.0
            [call] => W8BLV
            [distance] => 0.0
            [notes] => ottel
        )

    [1] => Array
        (
            [city] => Middletown
            [state] => OH
            [freq] => 146.715
            [pl] => 
            [call] => N8COZ
            [distance] => 0.0
            [notes] => ct
        )

    [2] => Array
        (
            [city] => Middletown
            [state] => OH
            [freq] => 147.315
            [pl] => 77.0
            [call] => W8JEU
            [distance] => 0.0
            [notes] => ottel
        )

    [3] => Array
        (
            [city] => Middletown
            [state] => OH
            [freq] => 443.5370
            [pl] => 118.8
            [call] => W8MUM
            [distance] => 0.0
            [notes] => oe oe
        )

    [4] => Array
        (
            [city] => Middletown
            [state] => OH
            [freq] => 444.4750
            [pl] => 100.0
            [call] => AG8Y
            [distance] => 0.0
            [notes] => ottel
        )

    [5] => Array
        (
            [city] => Middletown
            [state] => OH
            [freq] => 444.8250
            [pl] => 77.0
            [call] => W8BLV
            [distance] => 0.0
            [notes] => oel
        )

    [6] => Array
        (
            [city] => Monroe
            [state] => OH
            [freq] => 443.0870
            [pl] => 
            [call] => KC8ECK
            [distance] => 4.3
            [notes] => oep
        )

    [7] => Array
        (
            [city] => Franklin
            [state] => OH
            [freq] => 145.290
            [pl] => 118.8
            [call] => WB8ZVL
            [distance] => 5.5
            [notes] => o(ca)r
        )

    [8] => Array
        (
            [city] => Franklin
            [state] => OH
            [freq] => 442.4250
            [pl] => 77.0
            [call] => WE8N
            [distance] => 5.5
            [notes] => Oae(ca)
        )

    [9] => Array
        (
            [city] => Franklin
            [state] => OH
            [freq] => 443.1500
            [pl] => 118.8
            [call] => WB8ZVL
            [distance] => 5.5
            [notes] => o(ca)r
        )

    [10] => Array
        (
            [city] => Springboro
            [state] => OH
            [freq] => 145.490
            [pl] => 77.0
            [call] => W8CYE
            [distance] => 8.9
            [notes] => oe
        )

)

Ben almak için arıyorum çıktı böyle bir şey olması gerekir:

$rpt[0] ="Middletown 146.61/77, 146.715, 147.315/77, 443.537/118.8, 444.475/100, 444.825/77";
$rpt[1] = "Monroe 443.087";
$rpt[2] = "Franklin 145.29/118.8, 442.425/77, 443.15/118.8";
$rpt[3] = "Springboro 145.49/77"

The fields I am most interested in are the city, freq, pl - And if you look at the first array, I have removed the trailing zeros on the output array. There are also a couple of times when I may need to use the call field, and the notes field, but if someone can point me in the right direction I probably will be able to figure the rest I need - the call field and notes field would not be used often. I have tried a couple of different foreach loops, but I am still pretty much a novice at PHP - and what I've done hasn't worked correctly, and I'm at the point were I need a little help.

Thanks in advance for the help, LeRoy, KD8BXP

0 Cevap