您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

怎样根据$hello数据将$str层层展开?解决方案

2024/5/1 2:14:28发布14次查看
怎样根据$hello数据将$str层层展开?
怎样根据$hello数据将$str层层展开?
php codedir_ws_template.'includes/', dir_ws_classes =>dir_ws_admin.'helloworld', dir_ws_template =>template/, dir_ws_admin =>admin/ );//怎样得到这样的结果数组: $my_arr=array( dir_fs_aaa . dir_ws_classes, dir_ws_template.'includes/'.dir_ws_template.'includes/', template/includes/admin/includes/ );?>
------解决方案--------------------
php code$my_arr[] = $str;$tmp = preg_replace(/[a-z_]+/e, \$hello['\\0'], $str);$my_arr[] = $tmp;$tmp = preg_replace(/[\']?\s*\.?\s*([a-z_]+)\s*\.?\s*[\']/e, \$hello['\\1'], $tmp);$my_arr[] = $tmp;//testprint_r($my_arr);/**array( [0] => dir_fs_aaa . dir_ws_classes [1] => dir_ws_template.'includes/' . dir_ws_admin.'helloworld' [2] => template/includes/admin/helloworld')/**/

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product