PHPLib/functions.php

54 lines
825 B
PHP
Raw Permalink Normal View History

2013-01-31 15:24:10 -05:00
<?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;
}