Posted by Vince Morgan on 04/22/07 02:20
"Henk Oegema" <henk@oegema.com> wrote in message
news:9DvWh.133204$8X3.991299@phobos.telenet-ops.be...
> Vince Morgan wrote:
Jeff had the sense to consider there may be non numeric chars in the string
Henk.
for($i=0; $i<strlen($string); $i++)
{
if(is_numeric($string[$i]))
{
if($string[$i] < "5")
{
$string[$i] = $string[$i] + 5;
}else
{
$string[$i] = $string[$i] - 5;
}
}
}
The above would work fine in that case, because it takes non numeric chars
that into consideration.
However, I think Jeff's solution is a lot more intiutive actualy as it's
purpose is more obvious.
Good to see you got it working Henk.
Vince
Navigation:
[Reply to this message]
|