Results 1 to 6 of 6
  1. #1
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    strip html
    Michael Coley posted somewhere here that this code snippet (below) will remove all html from a specific field (in this case I think it's the desc field)

    Does anybody know how to do this in php please?

    $desc =~ s/<[^>]*>/ /g;
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  2. #2
    ABW Ambassador sjangro's Avatar
    Join Date
    January 18th, 2005
    Location
    Boston
    Posts
    1,529
    >> php

    $desc = strip_tags($desc);

  3. #3
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    Thanks Scot I'll give that a go.
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  4. #4
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    I've tried adding that bit of script to my import file before the table population duringthe table population and after the table population and it still will not delete the html. Am I doing something wrong or is there a little bit missing?

    I added it like this because my fieldname is description and not desc.
    $description = strip_tags($description);


    I am already using this (below) on the description field will it make any difference?
    $replace = array("");
    $replace_w = array("");
    One day parasites and their ilk will be made illegal, I bet a few Lawyers will be pissed off when the day comes.
    Mr. Spitzer is fetching it nearer

    YouTrek

  5. #5
    ABW Ambassador sjangro's Avatar
    Join Date
    January 18th, 2005
    Location
    Boston
    Posts
    1,529
    To help, Gordon, I'd need to see more of the code.

    You can pm it to me if you don't wanto post it. I don't need the whole thing, just a snipet that has the pertinent stuff.

  6. #6
    Affiliate Marketer Rogi's Avatar
    Join Date
    January 18th, 2005
    Location
    Melbourne
    Posts
    415
    htmlentities

  7. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. HTML in datafeed stays HTML in file?
    By Nintendo in forum WebMerge (Fourthworld.com)
    Replies: 1
    Last Post: August 17th, 2004, 10:05 PM
  2. Webmerge, do you strip the html beforehand?
    By gagglina in forum WebMerge (Fourthworld.com)
    Replies: 1
    Last Post: January 17th, 2004, 05:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •