functie-xml-info
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
function xmlinfo($str, $row, $limit=null, $attr=NULL)
{
if($attr != NULL)
{
preg_match_all("|<$row.*$attr=\"(.*)\".*>.*</$row>|U", $str, $xmlinfo);
}else{
preg_match_all("|<$row.*>(.*)</$row>|U", $str, $xmlinfo);
}
if($limit != null)
{
$xmlinfo = array_slice($xmlinfo[1], 0, $limit);
}else{
$xmlinfo = $xmlinfo[1];
}
return $xmlinfo;
}
?>
function xmlinfo($str, $row, $limit=null, $attr=NULL)
{
if($attr != NULL)
{
preg_match_all("|<$row.*$attr=\"(.*)\".*>.*</$row>|U", $str, $xmlinfo);
}else{
preg_match_all("|<$row.*>(.*)</$row>|U", $str, $xmlinfo);
}
if($limit != null)
{
$xmlinfo = array_slice($xmlinfo[1], 0, $limit);
}else{
$xmlinfo = $xmlinfo[1];
}
return $xmlinfo;
}
?>