Allowing you to keep those familiar alias's.
Such as [ic]indexOf(), charAt(), substring(), split()[/ic]
The first parameter is always the string on which to perform the function.
Code: Select all
function substring($str,$start,$end = false)
if(!$end) $end = strlen($str);
return substr($str,$start, $end - $start);
function lastIndexOf($str,$search,$start = 0)
function indexOf($str,$search,$start = 0)
As you can see these functions are tiny and in the bigger picture, a little pointless. But if you familiar with JS, this will provide a more familiar way of manipulting strings.