Sper ca am inteles ce vrei.
sauCod 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');
Cod PHP:$page = "<span>Hello</span>";
$pattern = "/<span>(.*?)<\/span>/";
preg_match($pattern, $page, $matches);
echo $matches[1];



Răspunde cu citat