Jump to content

[Help] Look for a value, and then replace it with another value.


lifetalk

Recommended Posts

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 :)

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.