no i've got the answert....
here are two functions.
the first one works that way. as attriput ou put the html tag and you'll get an array with all the attribut plus the name of the tag.
the second function you can put a hole htmlsite. As answered you will get an array with all the tags in the format i told you befor....
i hope it will serve you and it would not make a lot of trubles. I can work with it..
here the code..
i would make it saver if you want to use it realy
function get_tagattribut($str){
$res = array();
$arr = array();
ereg('<[^ >]+', $str,$res['tag']);
$res['tag']=substr($res['tag'][0],1,strlen($res['tag'][0]));
while(ereg('[^ <>]+[ ]=[ ][^ ><]+',$str,$arr)){
$arr= $arr[0];
$arr=explode('=',$arr);
$str = ereg_replace($arr[0].'[ ]=[ ]'.$arr[1],' ',$str);
$arr[1]=ereg_replace('["\']','',$arr[1]);
$res[trim($arr[0])]=trim($arr[1]);
}
return $res;
}
function parsehtml($str){
$arr = array();
$i = 1;
$temp='';
while(ereg('<[<>]+>',$str,$temp)){
$str = str_replace($temp[0],'',$str);
$temp= $temp[0];
$temp= get_tagattribut($temp);
if (isset($arr[$temp['tag']]))
{
$temp['tag']=$temp['tag'].$i;
$i++;
}
$arr[$temp['tag']]=$temp;
}
return $arr;
}
for testing her a debugger code.....
$test = '<loop name ="cool" atr1="value1" > <br> <jumbo type= elefant weight = "heavy">';
$res = parsehtml($ta);
foreach($r as $tag => $el)
{
foreach($el as $atr => $value )
{echo($tag.': '.$atr.'='.$value.'<br>');}
}