Skip to content

Instantly share code, notes, and snippets.

@forecho
Created May 4, 2017 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forecho/1554719caed897daaa279b80a65a05a4 to your computer and use it in GitHub Desktop.
Save forecho/1554719caed897daaa279b80a65a05a4 to your computer and use it in GitHub Desktop.
<?php
/**
* author : forecho <caizhenghai@gmail.com>
* createTime : 2016/3/30 16:47
* description:
*/
namespace common\helpers;
class StringHelper
{
/**
* 替换空白/换行
* @param $string
* @return string
*/
public static function trim($string)
{
return str_replace(["\r\n", "\r", "\n", " ", "\t"], '', $string);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment