lifetalk Posted November 14, 2008 Share Posted November 14, 2008 Ok... I don't really know how to lay out the subject.. but here is what I am trying to do. Just a side note, this is going to be a wordpress plugin. 1. Scan a post for a specific value/string (http://www.google.com , for example). 2. Once it finds something similar, replace that entire string with an HTML iframe code. It needs to use the original string in the post in the src part of the iframe code. So basically, the src part of the iframe code is a wildcard that will get replaced by the string that was earlier scanned for. Now, the question is, how do I do it? A simple starting point would be awesome. I can work my way through the rest.. What's the code for actually scanning the post for a specific string? All help appreciated Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted November 14, 2008 Share Posted November 14, 2008 sounds like you want something similar to BBcode? Quote Link to comment Share on other sites More sharing options...
lifetalk Posted November 14, 2008 Author Share Posted November 14, 2008 You could say that... distantly related though.. I just want it to scan the post for a typical megavideo.com video URL... and then replace the completely URL in the iframe src part.. and paste the complete iframe code replacing the original megavideo url that was typed in the post Quote Link to comment Share on other sites More sharing options...
zq29 Posted November 14, 2008 Share Posted November 14, 2008 preg_replace() Quote Link to comment Share on other sites More sharing options...
lifetalk Posted November 14, 2008 Author Share Posted November 14, 2008 Thanks. I'll look up on that. Would preg_replace_callback be of any use or be useful in this one? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.