There is a code

<?php ini_set('display_errors','On'); error_reporting('E_ALL'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://api.travelpayouts.com/v1/prices/calendar?currency=RUB&origin=MOW&destination=AER&calendar_type=departure_date"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Access-Token: ")); $response = curl_exec($ch); curl_close($ch); //var_dump($response); $obj = json_decode($response); echo '<table class="table table-hover">'; echo '<thead>'; echo '<tr>'; echo '<th>Дата вылета</th>'; echo '<th>Стоимость</th>'; echo '<th>Авиакомпания</th>'; echo '<th>Актуально до</th>'; echo '<th>Дата возвращения</th>'; echo '<th>Номер рейса</th>'; echo '<tr> '; $price = 0; $num = 0; $airline = array(); foreach ($obj->data as $key => $item) { $num++; $price += $item->price; if(isset($airline[$item->airline])){ $airline[$item->airline]++; }else{ $airline[$item->airline] = 1; } ; echo '<tr>'; echo '<td>' . date("dmY", strtotime("$item->departure_at")) . '</td>'; echo '<td>' . $item->price . '</td>'; echo '<td>' . $item->airline . '</td>'; echo '<td>' . date("dmY", strtotime("$item->expires_at")) . '</td>'; echo '<td>' . date("dmY", strtotime("$item->return_at")) . '</td>'; echo '<td>' . $item->flight_number . '</td>'; } echo '</tr> '; echo '</table>'; ?> 

I need the code instead of the text part of this code

 echo '<td>' . $item->airline . '</td>'; 

displayed airline logo having a path

 pics.avs.io/100/40/***.png 

where instead of asterisks would be the value

  $item->airline 

And it is also necessary that at the end of each line of the table there is a link with the name "Search" leading to

 bilety.avia-avia.ru/searches/new?origin_iata=MOW&destination_iata=***&depart_date=***&return_date=***&adults=1&children=0&infants=0&trip_class=0&marker=87111&with_request=true 

where instead of asterisks the values ​​from the table would be inserted. Here is something like this: http://avia-avia.ru/bilety_iz_moskvy/ Thank you in advance with respect.

    1 answer 1

    Replace this line:

     echo '<td>' . $item->airline . '</td>'; 

    On:

     echo '<td><img alt="" width="" height="" src="pics.avs.io/100/40/' . $item->airline . '.png"></td>'; 

    About the search is not clear to everyone, better specify.

     echo '<a href="bilety.avia-avia.ru/searches/new?origin_iata=MOW&destination_data=' . $item->flight_number . '&depart_date=' . date("dmY", strtotime("$item->departure_at")) . '&return_date=' . date("dmY", strtotime("$item->return_at")) . '&adults=1&children=0&infants=0&trip_class=0&marker=87111&with_request=true">Поиск</a>'; 

    In general, of course, it is better to read books on HTML and PHP.