<?php
function low($str){return strtolower($str);}
function up($str){return strtoupper($str); }
function rep($search,$replace,$subject){return str_replace($search,$replace,$subject);}
function len($str){ return strlen($str);}
function stripTrailingChars($str,$count){return substr($str,0,len($str)-$count);}
function camelCaseGetParts($str, $count=0)
{
$parts = array() ;
$partIndex = 1 ;
$len = len($str) ;
for($i=0;$i<$len;$i++)
{
$char = $str[$i];
if ($char===up($char))$partIndex++;
if($partIndex-1 == $count-1 && $count != 0)
{
$parts[$partIndex-1] = substr($str,$i,len($str));
return $parts;
}
$parts[$partIndex-1] .= $char;
}
return $parts;
}
function seriaizeAssocArray($array, $keyWrap,$betweenOp,$valueWrap,$sep)
{
$str = "";
foreach ( $array as $k=>$v)
$str.= "{$keyWrap}{$k}{$keyWrap}{$betweenOp}{$valueWrap}{$v}{$valueWrap}{$sep}";
return stripTrailingChars($str,1);
}
function seriaizeArray($array, $valueWrap,$sep)
{
$str = "";
foreach ( $array as $k=>$v)
$str.= "{$valueWrap}{$v}{$valueWrap}{$sep}";
return stripTrailingChars($str,1);
}
?>
|