Line break between PHP and HTML

0

You see, I have the following code:

<?php
    $limite=100;
    if(strlen($juego->desarrollo)>$limite)
        $d=substr($juego->desarrollo,0,$limite)."\r\n(Seguir Leyendo)";
    else
        $d=$juego->desarrollo;
?>
<hr>
<span style="background-color:#ffcb83; float: left; padding-left: 5px; padding-right: 4px; border-radius: 5px;">{{$d}}</span>

This is intended to show a variable, but if it is too long, cut it, make a line break and show a warning.

                    

                    {{$ d}}

But the line break does not occur. How do I fix it?

    
asked by Miguel Alparez 19.09.2018 в 21:42
source

1 answer

2

The problem is that the variable $ d is not recognized by html.

you must include the html tag inside the php body.

would be more or less like that.

    
answered by 20.09.2018 / 01:00
source