unidox Posted July 26, 2008 Share Posted July 26, 2008 I have this code: function get_tag_inside($content, $tag) { $content = preg_replace("@\{" . $tag . "\}(.+)\{\/" . $tag . "\}@i", "$1", $content); return $content; } function get_tag($tag, $replace, $tpl) { $replace = preg_replace("@\{" . $tag . "\}@", $replace, $tpl); return $replace; } $index = file_get_contents("pages/news.inc.php"); $site = get_tag("content", "body", $index); $site = get_tag_inside($site, "title"); echo $site; But the problem is, I dont want to replace the title, I just want to turn it into a variable and/or const. I am trying to get all the info inside the {title}{/title} tags. Link to comment https://forums.phpfreaks.com/topic/116766-help/ Share on other sites More sharing options...
.josh Posted July 26, 2008 Share Posted July 26, 2008 please don't make multiple threads asking the same thing. You already had a thread asking about this. You were redirected to the regex forum where you posted the same question. Now this one, asking the same thing. Asking the same thing over and over in multiple threads will not get your problem solved any faster. thread closed. Link to comment https://forums.phpfreaks.com/topic/116766-help/#findComment-600485 Share on other sites More sharing options...
Recommended Posts