Location: PHPKode > projects > Anahita Social Engine > dependencies/plg_system_socialengine/socialengine/util/string/helper.php
<?php
/**
 * @version		1.0.0
 * @category	Anahita Social Engine™
 * @copyright	Copyright (C) 2008 - 2010 rmdStudio Inc. and Peerglobe Technology Inc. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.anahitapolis.com
 */

class AnUtilStringHelper extends KObject
{
	static public function truncate($string, $options=array())
	{
		$options = array_merge(array('length'=>30,'omission'=>'...'), $options);
		return strlen($string) <= $options['length'] ? $string : substr($string,0,$options['length']).$options['omission'];
	}
}
Return current item: Anahita Social Engine