Jump to content

preg_replace help


UnknownPlayer

Recommended Posts

I have this code, but it doesn't work:

			$input = "http://loombo.com/tg6nuw42yahw";
			$search = "/http:\/\/(?:www\.)?loombo\.com\/(.*?)/is";
			$replace = "<iframe style='overflow: hidden; border: 0; width: 500px; height: 351px;' src='http://loombo.com/embed-$1-500x316.html' scrolling='no'></iframe>";
			echo preg_replace($search,$replace,$input);

Now this address in iframe should be: http://loombo.com/embed-tg6nuw42yahw-500x316.html, but it isn't.

When i look at souce code of page, address in that iframe is http://loombo.com/embed-[empty]-500x316.html

Can someone help me?

 

Link to comment
https://forums.phpfreaks.com/topic/235837-preg_replace-help/
Share on other sites

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.