S
S
sochi-russia2021-07-23 16:11:56
PHP
sochi-russia, 2021-07-23 16:11:56

Where is the error and what is it?

The code

<?php if($data['airline'] == null) echo "Обновление"; else echo "<img width='100' height='50' alt='авиакомпания на рейс Москва Санкт-Петербург' src='//site.ru/100/40/<?=$data['airline'] ?>.jpg' class='lazyload air'>" ?>

Gives an error message:
Syntax Error, Unexpected $EOF, Expecting T_String or T_variable or T_num_String


The bottom line is, if $data['airline']it does not have any values, then we write "Обновление", if there are values, then issue this
<img width="100" height="50" alt="авиакомпания на рейс Москва Санкт-Петербург" src="//site.ru/100/40/<?=$data['airline'] ?>.jpg" class="lazyload air"/>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
John Didact, 2021-07-23
@sochi-russia

<?=$data['airline'] ?>replace with {$data['airline']}and after the output expression put;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question