cjcmay 发表于 2017-3-4 07:13:03

php技巧集

  php 求长度(中英文适用)
  $length = mb_strlen(trim($introductionOpen),'utf-8')
  php 切割字符串长度(中英文适用)
  $strString =  mb_substr($introductionOpen, 0, 80, 'UTF-8');
  php 切割字符串最后一个字符(中英文适用)
  $currentCity =mb_substr($currentCity, -1, 1, 'UTF-8');
  php 切割字符串除了最后一个字符,取之前的字符串(中英文适用)
  $currentCity = mb_substr($currentCity, 0, -1, 'UTF-8');
  php 切割数组(去掉数组最后一个)
  $argumentArr = array_slice($arg_argumentArr, 0, -1);
  php 切割数组(去掉数组第一个)
  $fieldNames = array_slice($fieldNames,1);
  php foreach(键值形式)
  foreach ($movie as $key => $value)
  php 插入oracle TIMESTAMP字段(当前时间)
  INSERT INTO MYTABLE (FIELD )
  VALUES(CURRENT_TIMESTAMP )
页: [1]
查看完整版本: php技巧集