I am using the following code to display a few lines of text from a text field in my database.
This works fine, cause at least it only shows only the first few lines of text, but really what I'd like to accomplish is only showing the lines surrounding the term (which is represented by the variable $term) I searched for in the MySQL query.
Any suggestions are appreciated.
Code:
echo substr($row['item_text'],0,256)
This works fine, cause at least it only shows only the first few lines of text, but really what I'd like to accomplish is only showing the lines surrounding the term (which is represented by the variable $term) I searched for in the MySQL query.
Any suggestions are appreciated.