mardi 19 juin 2018

Parse error: syntax error, unexpected 'elseif', multiple elseif [duplicate]

This question already has an answer here:

Here is my code :

<?php
   if ($data[0][extraUrbanKmConsumption]<85 AND $data[0][energy][name] == "Diesel") { ?>
    <h5 class="text-light">Emission de cO2 : <?php echo $data[0][extraUrbanKmConsumption]; ?> <img src="icone c02/A.png" class="img-fluid" alt="Responsive image"></h5>
    <?php } ?> 
  <?php elseif ($data[0][extraUrbanKmConsumption]>=85 AND $data[0][extraUrbanKmConsumption]<115  AND $data[0][energy][name] == "Diesel") { ?>
    <h5 class="text-light">Emission de cO2 : <?php echo $data[0][extraUrbanKmConsumption]; ?> <img src="icone c02/B.png" class="img-fluid" alt="Responsive image"></h5>
    <?php } ?> 
  <?php elseif ($data[0][extraUrbanKmConsumption]>=115 AND $data[0][extraUrbanKmConsumption]<145  AND $data[0][energy][name] == "Diesel") { ?>
    <h5 class="text-light">Emission de cO2 : <?php echo $data[0][extraUrbanKmConsumption]; ?> <img src="icone c02/C.png" class="img-fluid" alt="Responsive image"></h5>
    <?php } ?> 
  <?php elseif ($data[0][extraUrbanKmConsumption]>=145 AND $data[0][extraUrbanKmConsumption]<175  AND $data[0][energy][name] == "Diesel") { ?>
    <h5 class="text-light">Emission de cO2 : <?php echo $data[0][extraUrbanKmConsumption]; ?> <img src="icone c02/D.png" class="img-fluid" alt="Responsive image"></h5>
    <?php } ?> 
  <?php elseif ($data[0][extraUrbanKmConsumption]>=175 AND $data[0][extraUrbanKmConsumption]<205  AND $data[0][energy][name] == "Diesel") { ?>
    <h5 class="text-light">Emission de cO2 : <?php echo $data[0][extraUrbanKmConsumption]; ?> <img src="icone c02/E.png" class="img-fluid" alt="Responsive image"></h5>
    <?php } ?> 
  <?php elseif ($data[0][extraUrbanKmConsumption]>=205 AND $data[0][extraUrbanKmConsumption]<235  AND $data[0][energy][name] == "Diesel") { ?>
    <h5 class="text-light">Emission de cO2 : <?php echo $data[0][extraUrbanKmConsumption]; ?> <img src="icone c02/F.png" class="img-fluid" alt="Responsive image"></h5>
    <?php } ?> 
  <?php elseif ($data[0][extraUrbanKmConsumption]>=235  AND $data[0][energy][name] == "Diesel") { ?>
    <h5 class="text-light">Emission de cO2 : <?php echo $data[0][extraUrbanKmConsumption]; ?> <img src="icone c02/G.png" class="img-fluid" alt="Responsive image"></h5>
    <?php } ?>

that return me this error : Parse error: syntax error, unexpected 'elseif' (T_ELSEIF), expecting end of file

where my syntax is wrong?

Aucun commentaire:

Enregistrer un commentaire