Posted by Henk Oegema on 04/21/07 11:02
Vince Morgan wrote:
>
> "Vince Morgan" <vinhar@REMOVEoptusnet.com.au> wrote in message
> news:46276af7$0$16552$afc38c87@news.optusnet.com.au...
>> You could reduce the if; elseif block to the following.
>>
>> $string[$i] = $string[$i]< 5 ? $string[$i]+=5 : ($string[$i]+=5)-10;
>>
>> That's if, as Jeff has already enquired, $string{$i} should be
> $string[$i].
>> HTH
>> Vince
>>
>>
>
> Ooops, I forgot you are dealing with chars rather than integers.
>
> $string[$i] = $string[$i]< "5" ? $string[$i]+=5 : ($string[$i]+=5)-10;
>
> Vince
Hei Vince
This line:
$string[$i] = $string[$i]< "5" ? $string[$i]+=5 : ($string[$i]+=5)-10;
gives me an Error:
Cannot use assign-op operators with overloaded objects nor string offsets
(I'm using NuSpherePhpED debugger from http://www.phped.com/)
[Back to original message]
|