var options = {
type: "basic",
title: "Extention Title",
message: 'Extention Message",
iconUrl: "images/icon_86.png" // My Case:Error in iconUrl
};
我对Regex有一点问题,我只想从html标签(包括标签)之间的所有内容中获取文本并创建包含这些结果的数组,但是,我无法将结果保存到数组中。
基本上,我需要以下回报:
function teste(){
$string = '<div>Hello, i am João</div><a href="test/test.com">testttttttttttt</a>';
$matches = array();
preg_match('/<[^>]*>/', $string, $matches, PREG_OFFSET_CAPTURE);
print_r($matches);exit();
}
答案 0 :(得分:1)
试试这个
<?php function teste(){
$string = '<div>Hello, i am João</div><a
href="test/test.com">testttttttttttt</a>';
$matches = array();
preg_match_all('/<[^>]*>/', $string, $matches);
echo '<pre>';
print_r($matches);
}