-7

我有一个包含子数组的数组。该数组的内容如下。

Array
(

        [AvailRequest] => Array
(
[Trip] => ONE
[Origin] => BLR
[Destination] => CMB
[DepartDate] => 2013-05-05
[ReturnDate] => 2013-05-10
[AdultPax] => 1
[ChildPax] => 0
[InfantPax] => 0
[Currency] => INR
[PreferredClass] => E
[Eticket] => true
[Clientid] => 
[Clienttype] => 
[PreferredAirline] => Array
(
)

)

[AvailResponse] => Array
(
[OriginDestinationOptions] => Array
(
[OriginDestinationOption] => Array
(
[0] => Array
(
[FareDetails] => Array
(
[ActualBaseFare] => 5250
[Tax] => 3980
[STax] => 0
[TCharge] => 0
[SCharge] => 0
[TDiscount] => 0
[TMarkup] => 0
[TPartnerCommission] => 0
[TSdiscount] => 0
[FareBreakup] => Array
(
[FareAry] => Array
(
[Fare] => Array
(
[PsgrType] => ADT
[BaseFare] => 5250
[Tax] => 3980
[TaxDataAry] => Array
(
[TaxData] => Array
(
[0] => Array
    (
        [Country] => IN
        [Amt] => 00000260
    )

[1] => Array
    (
        [Country] => JN
        [Amt] => 00000412
    )

[2] => Array
    (
        [Country] => WO
        [Amt] => 00000225
    )

[3] => Array
    (
        [Country] => YQ
        [Amt] => 00002983
    )

[4] => Array
    (
        [Country] => YR
        [Amt] => 00000100
    )

[5] => Array
    (
        [Country] => Other
        [Amt] => 0
    )

)

)

)

)

)

[ocTax] => 0
)

[onward] => Array
(
[FlightSegments] => Array
(
[FlightSegment] => Array
(
[0] => Array
(
[AirEquipType] => 737
[ArrivalAirportCode] => MAA
[ArrivalAirportName] => CHENNAI
[ArrivalDateTime] => 2013-05-05T11:25:00
[DepartureAirportCode] => BLR
[DepartureAirportName] => BANGALORE
[DepartureDateTime] => 2013-05-05T10:25:00
[FlightNumber] => 2308
[MarketingAirlineCode] => 9W
[OperatingAirlineCode] => 9W
[OperatingAirlineName] => Jet Airways 
[OperatingAirlineFlightNumber] => 2308
[NumStops] => 0
[LinkSellAgrmnt] => SS
[Conx] => Y
[AirpChg] => N
[InsideAvailOption] => N
[GenTrafRestriction] => ?
[DaysOperates] => YNNNNNN
[JrnyTm] => 570
[EndDt] => 20130505
[StartTerminal] => ?
[EndTerminal] => D
[FltTm] => 60
[LSAInd] => Y
[Mile] => 168
[BookingClass] => Array
(
[Availability] => 007
[BIC] => T
)

[BookingClassFare] => Array
(
[bookingclass] => T
[classType] => Economy
[farebasiscode] => Z4zAhRL7boXLdF8E7pg/Gg==
[Rule] => Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.
In addition to the airline's cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline's date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|
)

)

[1] => Array
(
[AirEquipType] => 737
[ArrivalAirportCode] => CMB
[ArrivalAirportName] => Colombo
[ArrivalDateTime] => 2013-05-05T19:55:00
[DepartureAirportCode] => MAA
[DepartureAirportName] => CHENNAI
[DepartureDateTime] => 2013-05-05T18:30:00
[FlightNumber] => 252
[MarketingAirlineCode] => 9W
[OperatingAirlineCode] => 9W
[OperatingAirlineName] => Jet Airways 
[OperatingAirlineFlightNumber] => 252
[NumStops] => 0
[LinkSellAgrmnt] => SS
[Conx] => N
[AirpChg] => N
[InsideAvailOption] => N
[GenTrafRestriction] => ?
[DaysOperates] => YNNNNNN
[JrnyTm] => 570
[EndDt] => 20130505
[StartTerminal] => I
[EndTerminal] => ?
[FltTm] => 85
[LSAInd] => Y
[Mile] => 402
[BookingClass] => Array
(
[Availability] => 007
[BIC] => Q
)

[BookingClassFare] => Array
(
[bookingclass] => Q
[classType] => Economy
[farebasiscode] => Z4zAhRL7boXLdF8E7pg/Gg==
[Rule] => Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.
In addition to the airline's cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline's date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|
)

)

)

)

)

[Return] => Array
(
)

[id] => arzoo20
[key] => j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PSTb6r/nBj+aKoV1rrhXWLu9m7LCuSh2USqCqgV+M+7rlAW7iVfIHCD/M6g9Fn4urlPHf4
z5IpRWgv/1cJX+vEdg4CnFRKt+2PZYo+CjOuGPE4fK4oZ+Lq5Tx3+M9KeFGbag7+buM+7rlAW7iV
dKLgjh+EGg8Mv3JUr8Yz2NNESEN0N1nFqHicn8G1rgW8dJypOMfNAYV1i7vZuywrLDDyeF89tBO3
AlP4UvcRhPpnSvkiAr2L00RIQ3Q3WcWoeJyfwbWuBfSvd+pfPzkTw71xV7mw3SMc8eW3maA+QtDB
5OI+F0YhaCiJ9H9rYKPukKmbTkvZCcO9cVe5sN0jgIzKpEpl/TD8JHLY76usS32v0HJWp1Wq1woh
nx7G7hF9r9ByVqdVqq4BjqJ/18fENhd+e+MjdHRf68R2DgKcVNA3bay1xpbmX+vEdg4CnFQgdHEE
lSxGoOQ21InO5LKMVlDj2j/U0d44GpAUHQLWmJgMLQm8WMNC5fDhDKShPUbVyE7F04/yYsB/nk1b
nBvGLM3Htbx7NGKQfdaRBAgvoSzNx7W8ezRi/dTqd6KPbtANxNRL4esrbtDB5OI+F0Yh5tQnacTr
bMjQweTiPhdGIRPGZkM1WLyW+mdK+SICvYt9r9ByVqdVqqLvE2QtpL7nX+vEdg4CnFQgdHEElSxG
oKEfJcGxYZN4y0wCTwW+1do9QrUro5miOg==
)

[1] => Array
(
[FareDetails] => Array
(
[ActualBaseFare] => 5250
[Tax] => 3980
[STax] => 0
[TCharge] => 0
[SCharge] => 0
[TDiscount] => 0
[TMarkup] => 0
[TPartnerCommission] => 0
[TSdiscount] => 0
[FareBreakup] => Array
(
[FareAry] => Array
(
[Fare] => Array
(
[PsgrType] => ADT
[BaseFare] => 5250
[Tax] => 3980
[TaxDataAry] => Array
(
[TaxData] => Array
(
[0] => Array
    (
        [Country] => IN
        [Amt] => 00000260
    )

[1] => Array
    (
        [Country] => JN
        [Amt] => 00000412
    )

[2] => Array
    (
        [Country] => WO
        [Amt] => 00000225
    )

[3] => Array
    (
        [Country] => YQ
        [Amt] => 00002983
    )

[4] => Array
    (
        [Country] => YR
        [Amt] => 00000100
    )

[5] => Array
    (
        [Country] => Other
        [Amt] => 0
    )

)

)

)

)

)

[ocTax] => 0
)

[onward] => Array
(
[FlightSegments] => Array
(
[FlightSegment] => Array
(
[0] => Array
(
[AirEquipType] => AT7
[ArrivalAirportCode] => MAA
[ArrivalAirportName] => CHENNAI
[ArrivalDateTime] => 2013-05-05T23:25:00
[DepartureAirportCode] => BLR
[DepartureAirportName] => BANGALORE
[DepartureDateTime] => 2013-05-05T22:15:00
[FlightNumber] => 2736
[MarketingAirlineCode] => 9W
[OperatingAirlineCode] => 9W
[OperatingAirlineName] => Jet Airways 
[OperatingAirlineFlightNumber] => 2736
[NumStops] => 0
[LinkSellAgrmnt] => SS
[Conx] => Y
[AirpChg] => N
[InsideAvailOption] => N
[GenTrafRestriction] => ?
[DaysOperates] => YNNNNNN
[JrnyTm] => 1300
[EndDt] => 20130505
[StartTerminal] => ?
[EndTerminal] => D
[FltTm] => 70
[LSAInd] => Y
[Mile] => 168
[BookingClass] => Array
(
[Availability] => 007
[BIC] => T
)

[BookingClassFare] => Array
(
[bookingclass] => T
[classType] => Economy
[farebasiscode] => Z4zAhRL7boXLdF8E7pg/Gg==
[Rule] => Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.
In addition to the airline's cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline's date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|
)

)

[1] => Array
(
[AirEquipType] => 737
[ArrivalAirportCode] => CMB
[ArrivalAirportName] => Colombo
[ArrivalDateTime] => 2013-05-06T19:55:00
[DepartureAirportCode] => MAA
[DepartureAirportName] => CHENNAI
[DepartureDateTime] => 2013-05-06T18:30:00
[FlightNumber] => 252
[MarketingAirlineCode] => 9W
[OperatingAirlineCode] => 9W
[OperatingAirlineName] => Jet Airways 
[OperatingAirlineFlightNumber] => 252
[NumStops] => 0
[LinkSellAgrmnt] => SS
[Conx] => N
[AirpChg] => N
[InsideAvailOption] => N
[GenTrafRestriction] => ?
[DaysOperates] => NYNNNNN
[JrnyTm] => 1300
[EndDt] => 20130506
[StartTerminal] => I
[EndTerminal] => ?
[FltTm] => 85
[LSAInd] => Y
[Mile] => 402
[BookingClass] => Array
(
[Availability] => 007
[BIC] => Q
)

[BookingClassFare] => Array
(
[bookingclass] => Q
[classType] => Economy
[farebasiscode] => Z4zAhRL7boXLdF8E7pg/Gg==
[Rule] => Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.
In addition to the airline's cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline's date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|
)

)

)

)

)

[Return] => Array
(
)

[id] => arzoo21
[key] => LGqyrlHGfTRf68R2DgKcVEb0gG2ZuxB2y+DauYeSiF3QweTiPhdGIWgoifR/a2Cj7pCpm05L2QnD
vXFXubDdIyuoEEf9FbAN4z7uuUBbuJWfy8uNPG/9b2fi6uU8d/jPtkPz+QotFGxf68R2DgKcVAxl
n+JT2sq20MHk4j4XRiFoKIn0f2tgo+sVQZmUH8fjjct7YYgqWIoUUZ48kBq4e4V1i7vZuywrLDDy
eF89tBO3AlP4UvcRhPpnSvkiAr2L00RIQ3Q3WcWoeJyfwbWuBTVGkVJ6dedZw71xV7mw3SOMG41f
vdQZIl/rxHYOApxUgFYoNoctSwTkUKibZHahg2fi6uU8d/jPAJdXKqYIvc7v3xbDmqRTwhltxinE
JKTa6xVBmZQfx+ONy3thiCpYikgRopJOZai5w71xV7mw3SOesti0ItOrM+qV6E/q3ryX4z7uuUBb
uJVda06JiVzmQQR9veF6y0bRIKp8gTNTb4LQweTiPhdGIWgoifR/a2CjWr3eMWg0Kj3DvXFXubDd
I75VFMSf1uBcZ+Lq5Tx3+M80wx+Qbml/2sYHugf2W7duhXWLu9m7LCu1fNZ0JD1Dq3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4esrbtDB5OI+F0Yh5tQnacTr
bMjQweTiPhdGIRPGZkM1WLyW+mdK+SICvYt9r9ByVqdVqqLvE2QtpL7nX+vEdg4CnFQgdHEElSxG
oKEfJcGxYZN4y0wCTwW+1do9QrUro5miOg==
)

[2] => Array
(
[FareDetails] => Array
(
[ActualBaseFare] => 5250
[Tax] => 3980
[STax] => 0
[TCharge] => 0
[SCharge] => 0
[TDiscount] => 0
[TMarkup] => 0
[TPartnerCommission] => 0
[TSdiscount] => 0
[FareBreakup] => Array
(
[FareAry] => Array
(
[Fare] => Array
(
[PsgrType] => ADT
[BaseFare] => 5250
[Tax] => 3980
[TaxDataAry] => Array
(
[TaxData] => Array
(
[0] => Array
    (
        [Country] => IN
        [Amt] => 00000260
    )

[1] => Array
    (
        [Country] => JN
        [Amt] => 00000412
    )

[2] => Array
    (
        [Country] => WO
        [Amt] => 00000225
    )

[3] => Array
    (
        [Country] => YQ
        [Amt] => 00002983
    )

[4] => Array
    (
        [Country] => YR
        [Amt] => 00000100
    )

[5] => Array
    (
        [Country] => Other
        [Amt] => 0
    )

)

)

)

)

)

[ocTax] => 0
)

[onward] => Array
(
[FlightSegments] => Array
(
[FlightSegment] => Array
(
[0] => Array
(
[AirEquipType] => 739
[ArrivalAirportCode] => MAA
[ArrivalAirportName] => CHENNAI
[ArrivalDateTime] => 2013-05-05T07:40:00
[DepartureAirportCode] => BLR
[DepartureAirportName] => BANGALORE
[DepartureDateTime] => 2013-05-05T06:50:00
[FlightNumber] => 7029
[MarketingAirlineCode] => 9W
[OperatingAirlineCode] => 9W
[OperatingAirlineName] => Jet Airways 
[OperatingAirlineFlightNumber] => 7029
[NumStops] => 0
[LinkSellAgrmnt] => SS
[Conx] => Y
[AirpChg] => N
[InsideAvailOption] => N
[GenTrafRestriction] => ?
[DaysOperates] => YNNNNNN
[JrnyTm] => 785
[EndDt] => 20130505
[StartTerminal] => ?
[EndTerminal] => D
[FltTm] => 50
[LSAInd] => Y
[Mile] => 168
[BookingClass] => Array
(
[Availability] => 007
[BIC] => T
)

[BookingClassFare] => Array
(
[bookingclass] => T
[classType] => Economy
[farebasiscode] => Z4zAhRL7boXLdF8E7pg/Gg==
[Rule] => Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.
In addition to the airline's cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline's date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|
)

)

[1] => Array
(
[AirEquipType] => 737
[ArrivalAirportCode] => CMB
[ArrivalAirportName] => Colombo
[ArrivalDateTime] => 2013-05-05T19:55:00
[DepartureAirportCode] => MAA
[DepartureAirportName] => CHENNAI
[DepartureDateTime] => 2013-05-05T18:30:00
[FlightNumber] => 252
[MarketingAirlineCode] => 9W
[OperatingAirlineCode] => 9W
[OperatingAirlineName] => Jet Airways 
[OperatingAirlineFlightNumber] => 252
[NumStops] => 0
[LinkSellAgrmnt] => SS
[Conx] => N
[AirpChg] => N
[InsideAvailOption] => N
[GenTrafRestriction] => ?
[DaysOperates] => YNNNNNN
[JrnyTm] => 785
[EndDt] => 20130505
[StartTerminal] => I
[EndTerminal] => ?
[FltTm] => 85
[LSAInd] => Y
[Mile] => 402
[BookingClass] => Array
(
[Availability] => 007
[BIC] => Q
)

[BookingClassFare] => Array
(
[bookingclass] => Q
[classType] => Economy
[farebasiscode] => Z4zAhRL7boXLdF8E7pg/Gg==
[Rule] => Cancellation Penalty: All bookings done are subject to the cancellation penalty levied by the respective airline.
In addition to the airline's cancellation penalty, we charge a service fee of Rs. 200 per passenger for all cancellations.|Date Change Penalty: In addition to the airline's date change penalty, we charge a service fee of Rs. 250 per passenger for any date changes.|
)

)

)

)

)

[Return] => Array
(
)

[id] => arzoo22
[key] => DsEEIVONfp1f68R2DgKcVEb0gG2ZuxB2y+DauYeSiF3QweTiPhdGIWgoifR/a2Cj7pCpm05L2QnD
vXFXubDdIyuoEEf9FbAN4z7uuUBbuJWfy8uNPG/9b2fi6uU8d/jPtk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3+M9KeFGbag7+buM+7rlAW7iV
dKLgjh+EGg8Mv3JUr8Yz2NNESEN0N1nFqHicn8G1rgW8dJypOMfNAYV1i7vZuywrLDDyeF89tBO3
AlP4UvcRhPpnSvkiAr2L00RIQ3Q3WcWoeJyfwbWuBfSvd+pfPzkTw71xV7mw3SMc8eW3maA+QtDB
5OI+F0YhaCiJ9H9rYKPukKmbTkvZCcO9cVe5sN0jgIzKpEpl/TD8JHLY76usS32v0HJWp1Wq1woh
nx7G7hF9r9ByVqdVqq4BjqJ/18fENhd+e+MjdHRf68R2DgKcVNA3bay1xpbmX+vEdg4CnFQgdHEE
lSxGoOQ21InO5LKMVlDj2j/U0d44GpAUHQLWmJgMLQm8WMNC5fDhDKShPUbVyE7F04/yYsB/nk1b
nBvGLM3Htbx7NGKQfdaRBAgvoSzNx7W8ezRi/dTqd6KPbtANxNRL4esrbtDB5OI+F0Yh5tQnacTr
bMjQweTiPhdGIRPGZkM1WLyW+mdK+SICvYt9r9ByVqdVqqLvE2QtpL7nX+vEdg4CnFQgdHEElSxG
oKEfJcGxYZN4y0wCTwW+1do9QrUro5miOg==
)
)

                )

        )

)

现在为了显示第一个结果的航班号,我使用下面的代码。

$array_data <-- The Whole above data is in this variable

$s=0;
foreach($array_data as $array)
{
echo $c=$array['AvailResponse']['OriginDestinationOptions']['OriginDestinationOption']['0']['onward']['FlightSegments']['FlightSegment']['$s']['FlightNumber'];
$s++;
}

我没有得到任何结果。我的代码有什么问题吗..?

谢谢,肖巴。

4

3 回答 3

0

只是一件事......在你的回声语句中,你有 $s 用单引号(')包裹,除非它在双引号(“)中,否则不会读取变量。即:[“$s”]。或者你可以做[''.$s.''] 或者只是一起删除引号 [$s]。

现在修复...

foreach($array_data['AvailResponse']['OriginDestinationOptions']['OriginDestinationOption']['0']['onward']['FlightSegments']['FlightSegment'] as $array)
{
    echo $c=$array['FlightNumber'];
}

不是一个非常优雅的解决方案,但它有效。

工作代码的链接:http: //phpfiddle.org/main/code/k9s-3i1

于 2013-05-02T07:54:31.113 回答
0

您正在尝试访问已知位置的数据。我不明白为什么你必须做一个循环。

echo $array_data['AvailResponse']['OriginDestinationOptions']['OriginDestinationOption']['0']['onward']['FlightSegments']['FlightSegment']['$s']['FlightNumber'];

于 2013-05-02T07:44:00.653 回答
0

像这样试试

foreach($array_data as $array)
{
    if(is_array($array))
    {
        foreach($array as $arr)
        {
             //Do the stuff
        } 
    }  
     //Do the stuff
}

只需检查它是否每次都是一个数组。如果是则应用另一个 foreach 循环

于 2013-05-02T07:23:37.337 回答