GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP Help (https://gfy.com/showthread.php?t=1074706)

BSleazy 07-15-2012 12:49 PM

PHP Help
 
What php code would I use to strip [tags]keywords,keywords,etc[/tags] from a feed?

- Jesus Christ - 07-15-2012 12:54 PM

You're welcome.

Code:

<php

$string=="input";;
beep_bop_boop(code bits, $string];

?php>


BSleazy 07-15-2012 03:50 PM

Maybe I'll try fivver for the first time :)

Klen 07-15-2012 03:59 PM

Quote:

Originally Posted by BCyber (Post 19060856)
Maybe I'll try fivver for the first time :)

Make an output what exactly you want to get since it's not entirely clear ;)

BSleazy 07-15-2012 04:41 PM

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]

livexxx 07-15-2012 05:11 PM

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

woj 07-15-2012 05:55 PM

if you want to invest a few bucks, hit me up, icq: 33375924

kazymjir 07-15-2012 06:21 PM

Code:

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


Brujah 07-15-2012 08:15 PM

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

Zoxxa 07-15-2012 08:19 PM

Quote:

Originally Posted by kazymjir (Post 19061001)
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.


All times are GMT -7. The time now is 03:39 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123