<input type="text" class="form-control txt_respuesta54_act" name="txt_respuesta54_act" required value="
<?php
if ($trim == 1){echo trim($respuesta_Trans_Q2);}
elseif ($trim == 2){echo $respuesta_Trans_Q3;}
elseif ($trim == 3){echo $respuesta_Trans_Q4;}
elseif ($trim == 4){echo $respuesta_Trans_Q1;}
?>">
This code does retrieve from the BD values depending on the current value of $ trim, the problem arises in the blank spaces that precede the input, the result of the image is the way in which it shows them .