Im working on a website with videos, but I have a problem. When I try to make a list of videos using foreach every variable of it includes a space on end even after trying to use str_replace... nothing worked. Here is the code:
<?php
$serialy_ = explode("\n", $serialy);
foreach($serialy_ as $serial) {
?>
<div class="serial_card" style="background-image: url(<?php echo "titles/" . $serial . ".png"; ?>);">
<h3><?php echo $serial; ?></h3>
</div>
<?php
}
?>
$serialy. Just 4 or 5 lines should be sufficient. It seems likely that the extra spaces are in your data, and the problem is GIGO. – Jim L. Aug 12 '19 at 22:13