【发布时间】:2015-10-15 11:05:09
【问题描述】:
我有详细信息数组:
[info_details] => Array
(
[0] => <b>title:</b> this is title
[1] => <b>name:</b> this is name
[2] => <b>created</b> this is date
)
我需要将此数组格式化为:
[info_details] => Array
(
[title] => this is title
[name] => this is name
[created] => this is date
)
那么爆炸粗体文本的最佳方法是什么? 我现在的代码:
foreach ( $array as $key => $value ) {
$this->__tmp_data['keep'][] = preg_split('/<b[^>]*>/', $value);
}
但它不起作用。
【问题讨论】:
标签: php arrays explode preg-split