ugly-wan Posted June 23, 2009 Share Posted June 23, 2009 Hi as i said at some point last week when i asked for help i am new to php and don't understand it completely. Well what i want to do is enter a bunch of urls in to a text area and replace parts of the urls with something else in to another text area similar to THIS This code is what i have come up with but how would i get that in to the same layout as the link above using str_replace or is there a better way? <? if($_GET['url']){$url = $_GET['url']; $name = $_GET['name'];}else{ die('you forgot something try again');} //Vreel Link String $rawstring = "$url"; //placeholders array $placeholders = array('http://beta.vreel.net/watch_', '.html',); //Vreel replace values array $vreelvals = array('http://olliestvlinks.hozzamedia.com/vreel/?vc=', '&name=',); //vreel string $vreelstr = str_replace($placeholders, $vreelvals, $rawstring); echo "URL: ". $vreelstr ; echo "$name"; ?> I hope you understand what i am saying Regards Ollie P.S this is how it works so far http://olliestvlinks.hozzamedia.com/test/replace.php?url=http://beta.vreel.net/watch_23626.html&name=How%20To Link to comment https://forums.phpfreaks.com/topic/163430-solved-replace-text-in-text-area-with-str_replace/ Share on other sites More sharing options...
ugly-wan Posted June 24, 2009 Author Share Posted June 24, 2009 never mind worked it out Link to comment https://forums.phpfreaks.com/topic/163430-solved-replace-text-in-text-area-with-str_replace/#findComment-862945 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.