I have a variable in my PHP code where its equal to a stored string. A small portion of this string is taken and used as a preview on a different page. On occasion there will be Javascript in that string, how could I say the following:
Pseudocode:
if stringVar contains "<script"
then remove the substring starting at "<script" and ending at "/script>"