慢慢累积正则 存下来

<?php
   /*好久没用正则了都忘的差不多了,以后所有的正则都放在这里  ,方便以后查找复用 */

//下面是防止意外 处理拼接字符 ,
$data['otherlicense'] = str_replace(',,',',',$data['otherlicense']);
$pattern = "/^(.*),$/";
preg_match($pattern , $data['otherlicense'], $matches);
if($matches)
	$data['otherlicense'] = $matches[1];
$pattern = "/^,(.*)$/";
	preg_match($pattern , $data['otherlicense'], $matches);
if($matches)
	$data['otherlicense'] = $matches[1];
//合作协议图片处理 结束


你可能感兴趣的:(慢慢累积正则 存下来)