Php 查找用户定义的开始和结束标记之间的所有内容
如何找到打开{table}和关闭标记{/table}之间的所有内容 e、 gPhp 查找用户定义的开始和结束标记之间的所有内容,php,Php,如何找到打开{table}和关闭标记{/table}之间的所有内容 e、 g {table}这是table{/table} 我希望所有html标记都应该在{table}标记中删除$input='{table}这是table{/table}'; $input = '{table} This is <strong>table</strong> {/table}'; $output = ''; preg_match('/\{table\}(.*?)\{\/table\}/'
{table}这是table{/table}
我希望所有html标记都应该在{table}标记中删除$input='{table}这是table{/table}';
$input = '{table} This is <strong>table</strong> {/table}';
$output = '';
preg_match('/\{table\}(.*?)\{\/table\}/', $input, $matches);
if ( !empty($matches[1]) ) {
$output = stripslashes($matches[1]);
}
$output='';
预匹配('/\{table\}(.*?\{\/table\}/',$input,$MATCHS);
如果(!empty($matches[1])){
$output=stripslashes($matches[1]);
}
比如
aa {table} This is <strong>table</strong> {/table} kk
aa{table}这是table{/table}kk
这将给
aa {table} This is table {/table} kk
aa{table}这是table{/table}kk
aa {table} This is <strong>table</strong> {/table} kk
aa {table} This is table {/table} kk