<?php
$str = 'てすと<img src="test.jpg">テスト';
$test = strip_tags($str);
print_r($test."<br>");
$content = 'てすと <img src="7-pictures-of-pretty-elene-gedevanishvili04.jpg"> テスト';
$pattern = "/\<img ([^\>]+)\>/i";
//$pattern = "/<img.*?\/>/";
preg_match_all($pattern, $content, $images);
foreach($images as $data){
foreach($data as $data2){
print_r($data2."★<br>");
}
print_r($data."●<br>");
}
print_r(count($images)."<br>");
?>
0 件のコメント:
コメントを投稿