[plug] Stripping out Markups in SQL

Trevor Phillips T.Phillips at murdoch.edu.au
Tue Sep 17 11:08:41 WST 2002


On Saturday 14 September 2002 17:19, Lyndon Kroker wrote:
> You may want to consider the use of PHP as there is a custom function for
> this.  PHP can be imbedded into the text of an html document if required.
>
> The function is called strip_tags(). Here is an example:
>
> $string = strip_tags($string, '<a><b><i><u>');

I know how to do it in any number of languages, but I really need to do it in 
the SQL query itself, since I both sort and filter using a Markup-less 
version of a text field.

Sure, I could just get every match, and filter in code, but that would be very 
inefficient.

-- 
. Trevor Phillips             -           http://jurai.murdoch.edu.au/ . 
: Web Technical Administrator     -          T.Phillips at murdoch.edu.au : 
| IT Services                        -              Murdoch University | 
 >--------------------------------------------------------------------<
| On nights such as this, evil deeds are done. And good deeds, of     /
| course. But mostly evil, on the whole.                             /
 \      -- (Terry Pratchett, Wyrd Sisters)                          /



More information about the plug mailing list