1 |
1546
|
Luisehahne
|
<?php
|
2 |
|
|
/**
|
3 |
|
|
* QuickSkin Extension truncate
|
4 |
|
|
* Restricts a String to a specific number characters
|
5 |
|
|
*
|
6 |
|
|
* Usage Example:
|
7 |
|
|
* Content: $template->assign('TEASER', 'PHP 4.3.0RC1 has been released. This is the first release candidate');
|
8 |
|
|
* Template: News: {truncate:TEASER,50} ... [more]
|
9 |
|
|
* Result: News: QuickSkin version 5.0 has been released. This is the first ... [more]
|
10 |
|
|
*
|
11 |
|
|
* @author Andy Prevost andy@codeworxtech.com - original by Philipp v. Criegern philipp@criegern.de
|
12 |
|
|
*/
|
13 |
|
|
function qx_truncate ( $param, $size ) {
|
14 |
|
|
return substr( $param, 0, $size );
|
15 |
|
|
}
|