查询一个表中字段重复情况,subject为查询的重复字段,as count为重复次数select `subject`,count(*) as count from wl_dpdf group by `subject` having count>1;
Mysql函数replace替换某字段内容update course_room set course_ppt=replace(course_ppt,"需要替换的内容","替换为最终需要的内容");
Mysql中FIND_IN_SET的使用
比如我们有一个字段为:userids{23,34,56,76,23},只想查询userids字段中包含”56″这个参数的所有行:SELECT * FROM `userGroup` WHERE FIND_IN_SET('56',userids);
PHP正则匹配图片地址$str = "aass";
$pattern="//";
preg_match_all($pattern,$str,$match);
var_dump($match);
正则替换文本中所有图片,如:给每个图片加宽度$Ifind['intro'] = preg_replace('//i', '', $Ifind['intro']);
file_put_contents() 函数把一个字符串写入文件中,与依次调用 fopen(),fwrite() 以及 fclose() 功能一样file_put_contents("./test.txt","data",FILE_APPEND);//FILE_APPEND附加到文件中
str_replace()数组替换str_replace(array("(", ")", "|"),array("","","-"),$sphinxKey);
str_replace(array("(", ")", "|"),array(""),$sphinxKey);
array_merge 合并一个或多个数组,相同的K会被后数组覆盖$array1 = array("color" => "red", 2, 4);
$array2 = array("a", "b", "color" => "green", "shape" => "trapezoid", 4);
$result = array_merge($array1, $array2);
js中打印对象JSON.stringify(this.state)