<?php
//Script by PC man @ majidonline.com
$text = "Php is my [tag]favorite[/tag] you try it!";
$tag1 = "[tag]";
$tag2 = "[/tag]";
$tag1_len = strlen($tag1);
$seek1 = strstr($text,$tag1);
$seek2 = strstr($text,$tag2);
if($seek1 & $seek2) {
$pos1 = strpos($text,$tag1);
$pos2 = strpos($text,$tag2);
$split_len = $pos2 - $pos1;
$text = substr($text,$pos1,$split_len);
$text = substr($text,$tag1_len);
echo $text;
}else{
echo "Tags not found!";
}
?>