PHP Classes

File: vendor/jackbooted/util/StringUtil.php

Recommend this page to a friend!
  Classes of Brett Dutton   JackBooted PHP Framework   vendor/jackbooted/util/StringUtil.php   Download  
File: vendor/jackbooted/util/StringUtil.php
Role: Class source
Content type: text/plain
Description: Class source
Class: JackBooted PHP Framework
Web application framework using simplified MVC
Author: By
Last change:
Date: 8 years ago
Size: 537 bytes
 

Contents

Class file image Download
<?php
namespace Jackbooted\Util;

/**
 * @copyright Confidential and copyright (c) 2016 Jackbooted Software. All rights reserved.
 *
 * Written by Brett Dutton of Jackbooted Software
 * brett at brettdutton dot com
 *
 */

class StringUtil extends \Jackbooted\Util\JB {

    public static function
unitsFormat ( $num, $units, $msg='' ) {
        return
$msg . ( ( $msg == '' ) ? '' : ' ' ) . $num . ' ' . $units . self::plural( $num );
    }

    public static function
plural ( $num ) {
        return (
$num == 1 ) ? '' : 's';
    }
}