function
Getpic(
$body
)
{
$getpic
=
‘‘
;
preg_match_all(
"/(src)=[\\"|‘| ]{0,}([^>]*\\.(gif|jpg|bmp|png))/isU"
,
$body
,
$img_array
);
$img_array
=
array_unique
(
$img_array
[2]);
if
(
count
(
$img_array
)>0)
{
foreach
(
$img_array
as
$key
=>
$value
)
{
$picname
= preg_replace(
"/[\\"|‘| ]{1,}/"
, ‘‘,
$value
);
$getpic
.=
"<p><img src=‘"
.
$picname
.
"‘ border=0 /></p>"
;
}
}
else
{
$getpic
=
"<p>没有图片</p>"
;
}
return
$getpic
;
}
{dede:list pagesize=‘10‘ addfields=‘body‘}
<
li
><
a
href
=
‘[field:arcurl /]‘
target
=
‘_blank‘
>
<
span
class
=
"title"
>[field:title /]</
span
>
[field:body function=‘Getpic(@me)‘/]
</
a
></
li
>
{/dede:list}