Althought I am sure there is a better way of doing this, I wrote a little function I call left() which allows me to get x# of characters from a string starting at the left
ie.."22779" and I want 4 characters of it you say left("22779",4) and it returns "2277", or you can call strlen() -1 to get the length minus 1
<pre>
function left($string,$arg) {
$string = (string) $string;
for ($arg = --$arg; $i <= $arg; $i++) {
$s .= $string[$i];
}
return $s;
}
</pre>
example
<pre>
$a = "27798";
$a = left($a,strlen($a) - 1);
echo("$a");
</pre>