Possible Duplicate:
How to select rows that start with “<img” with an IF statement
I am trying to add “/images” to the beginning of the row text_image when the text within begins with img. It is giving me an error.
while($row = mysql_fetch_array( $result3 )) {
echo "<div class='entry'>";
$images = (substr($row['text_image']), 0, 3) == 'img') ? "/images" : "";
echo $images . $row['text_image'];
echo "</div>";
}
You have an extra parenthesis. Try: