PHP Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BSleazy
    Confirmed User
    • Aug 2002
    • 6721

    #1

    PHP Help

    What php code would I use to strip [tags]keywords,keywords,etc[/tags] from a feed?
    icq 156131086
  • - Jesus Christ -
    Confirmed User
    • Mar 2003
    • 7197

    #2
    You're welcome.

    Code:
    <php
    
    $string=="input";;
    beep_bop_boop(code bits, $string];
    
    ?php>

    Amen

    Comment

    • BSleazy
      Confirmed User
      • Aug 2002
      • 6721

      #3
      Maybe I'll try fivver for the first time
      icq 156131086

      Comment

      • Klen
        • Aug 2006
        • 32235

        #4
        Originally posted by BCyber
        Maybe I'll try fivver for the first time
        Make an output what exactly you want to get since it's not entirely clear ;)

        Comment

        • BSleazy
          Confirmed User
          • Aug 2002
          • 6721

          #5
          Its from an rss feed i'm syndicating and it's adding this to the bottom of the posts.

          [tags]amateur, anal, teen,etc[/tags]
          icq 156131086

          Comment

          • livexxx
            Confirmed User
            • May 2005
            • 1201

            #6
            You need to look up preg_replace

            http://php.net/manual/en/function.preg-replace.php

            Use [tags] and [/tags] and a wild card in the middle
            http://www.webcamalerts.com for auto tweets for web cam operators

            Comment

            • woj
              <&(©¿©)&>
              • Jul 2002
              • 47882

              #7
              if you want to invest a few bucks, hit me up, icq: 33375924
              Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
              Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
              Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

              Comment

              • kazymjir
                Confirmed User
                • Oct 2011
                • 411

                #8
                Code:
                <?php
                 
                $str = "Remove this [tags]amateur, anal, teen,etc[/tags] stuff out of here!";
                 
                $regexp = "#\[tags\](.*?)\[/tags\]#is";
                 
                echo preg_replace($regexp, "", $str);
                 
                ?>
                http://kazymjir.com/

                Comment

                • Brujah
                  Beer Money Baron
                  • Jan 2001
                  • 22157

                  #9
                  http://stackoverflow.com/questions/9...lace-stripping

                  Comment

                  • Zoxxa
                    Confirmed User
                    • Feb 2011
                    • 1026

                    #10
                    Originally posted by kazymjir
                    Code:
                    <?php
                     
                    $str = "Remove this [tags]amateur, anal, teen,etc[/tags] stuff out of here!";
                     
                    $regexp = "#\[tags\](.*?)\[/tags\]#is";
                     
                    echo preg_replace($regexp, "", $str);
                     
                    ?>

                    I did not test this, but looks good to me.

                    I would also check out the explode() function after this and split it up using the comma delimiter into an array so you could then add each individual tag into a normalized DB.
                    [email protected]
                    ICQ: 269486444
                    ZoxEmbedTube - Build unlimited "fake" tubes with this easy 100% unencoded CMS!

                    Comment

                    Working...