PHPLib/functions.php

54 рядки
825 B
PHP

<?php
/**
* PHPLib
*
* A PHP library to wrap php functions in a standard fashion
*
* @package PHPLib
* @author Timothy J. Warren
* @copyright Copyright (c) 2013
* @link https://github.com/aviat4ion/PHPLib
* @license MIT
*/
// --------------------------------------------------------------------------
/**
* Access function for string methods
*
* @param string $str
* @return object
*/
function str($str)
{
static $str_obj;
if ( ! isset($str_obj))
{
$str_obj = new \PHPUtil\Str('');
}
$str_obj->__construct($str);
return $str_obj;
}
/**
* Access function for array methods
*
* @param array $array
* @return object
*/
function arr(array $array)
{
static $arr_obj;
if ( ! isset($arr_obj))
{
$arr_obj = new \PHPUtil\Arr(array());
}
$arr_obj->__construct($arr);
return $arr_obj;
}