I have two columns, Entry and text_image, in a table. When looping to see all the rows in an array, I can get the results, but I want it to add
Entry
text_image
$images = (substr($row['text_image'], 0, 3) == 'img') ? "/images" : ""; echo $images . $row['text_image'];
This will check if the first 3 letters of $row['text_image'] are img then set $images to /images else it will leave it empty. This will update each time within the loop.
$row['text_image']
img
$images
/images