[Solved] Assign an array in an array variable in PHP


Following way to do array combine.

1)

<?php
$segmentVal = array(
      'Origin' => 'DEL',
      'Destination' => 'CCU',
      'FlightCabinClass' => 2,
      'PreferredDepartureTime' => '2017-10-13T00:00:00',
      'PreferredArrivalTime' => '2017-10-13T00:00:00'
   );


  $jsonData = array(
      'EndUserIp' => $ipAddress,
      'TokenId' => 'a58c1052-c08f-4f40-9a9c-8841de585a14',
      'AdultCount' => 1,
      'ChildCount' => 0,
      'InfantCount' => 0,
      'DirectFlight' => 1,
      'OneStopFlight' => 0,
      'JourneyType' => 1,
      'Segments' => $segmentVal
   );
?>

2)

<?php

    $jsonData = array(
          'EndUserIp' => $ipAddress,
          'TokenId' => 'a58c1052-c08f-4f40-9a9c-8841de585a14',
          'AdultCount' => 1,
          'ChildCount' => 0,
          'InfantCount' => 0,
          'DirectFlight' => 1,
          'OneStopFlight' => 0,
          'JourneyType' => 1,
          'Segments' => array(
               'Origin' => 'DEL',
               'Destination' => 'CCU',
               'FlightCabinClass' => 2,
               'PreferredDepartureTime' => '2017-10-13T00:00:00',
               'PreferredArrivalTime' => '2017-10-13T00:00:00'
            )
       );

    ?>

solved Assign an array in an array variable in PHP