Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 07-15-2012, 12:49 PM   #1
BSleazy
Confirmed User
 
Industry Role:
Join Date: Aug 2002
Location: USA
Posts: 6,721
PHP Help

What php code would I use to strip [tags]keywords,keywords,etc[/tags] from a feed?
__________________
icq 156131086
BSleazy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-15-2012, 12:54 PM   #2
- Jesus Christ -
Confirmed User
 
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
You're welcome.

Code:
<php

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

?php>
__________________

Amen
- Jesus Christ - is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-15-2012, 03:50 PM   #3
BSleazy
Confirmed User
 
Industry Role:
Join Date: Aug 2002
Location: USA
Posts: 6,721
Maybe I'll try fivver for the first time
__________________
icq 156131086
BSleazy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-15-2012, 03:59 PM   #4
Klen
 
Klen's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
Quote:
Originally Posted by BCyber View Post
Maybe I'll try fivver for the first time
Make an output what exactly you want to get since it's not entirely clear ;)
Klen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-15-2012, 04:41 PM   #5
BSleazy
Confirmed User
 
Industry Role:
Join Date: Aug 2002
Location: USA
Posts: 6,721
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
BSleazy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-15-2012, 05:11 PM   #6
livexxx
Confirmed User
 
livexxx's Avatar
 
Industry Role:
Join Date: May 2005
Location: UK
Posts: 1,201
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
livexxx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-15-2012, 05:55 PM   #7
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
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
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-15-2012, 06:21 PM   #8
kazymjir
Confirmed User
 
kazymjir's Avatar
 
Industry Role:
Join Date: Oct 2011
Location: Munich
Posts: 411
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/
kazymjir is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-15-2012, 08:15 PM   #9
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
http://stackoverflow.com/questions/9...lace-stripping
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-15-2012, 08:19 PM   #10
Zoxxa
Confirmed User
 
Zoxxa's Avatar
 
Industry Role:
Join Date: Feb 2011
Location: Ontario, Canada
Posts: 1,026
Quote:
Originally Posted by kazymjir View Post
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!
Zoxxa is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.