Citat Postat în original de kis Vezi Post
Sper ca am inteles ce vrei.
Cod PHP:
function textulmeu($page,$tag)
{
$pattern "/<$tag>(.*?)<\/$tag>/";
preg_match($pattern$page$matches);
return 
$matches[1];
}

$page '<span>Textul extras</span>';
echo 
textulmeu($page'span'); 
sau

Cod PHP:
$page "<span>Hello</span>";
$pattern "/<span>(.*?)<\/span>/";
preg_match($pattern$page$matches);
echo 
$matches[1]; 
nu prea o sa mearga chestia asta $pattern = "/<$tag>(.*?)<\/$tag>/"; cand contine si atribute tagul...