PDA

View Full Version : Parse error. Probably simple, dunno how to describe better. Sorry.


Spudhead
05-01-2003, 11:06 AM
Following on from this thread (http://www.codingforums.com/showthread.php?s=&threadid=18272), I'm getting a 'parse error' on the following line:


$hexBrightness=(((299($rVal * $rVal * $rVal)) + (587($gVal * $gVal * $gVal)) + (114($bVal * $bVal * $bVal)))/1658137500);


Being completely unfamiliar with PHP, I don't know what's wrong or what to do about it. The brackets match up, the syntax looks ok (but what would I know?) Can anyone shed any light?

Phantom
05-01-2003, 11:19 AM
(114($bVal * $bVal * $bVal)))/1658137500);

You have 1 too many )s...should be

(114($bVal * $bVal * $bVal))/1658137500);

Spudhead
05-01-2003, 11:36 AM
Are you sure? I make it 8 open brackets and 8 close - and I still get a parse error on:

$hexBrightness=(((299($rVal * $rVal * $rVal)) + (587($gVal * $gVal * $gVal)) + (114($bVal * $bVal * $bVal))/1658137500);

Sorry - this is a really simple one I'm sure but I'm stuffed if I can spot it.

Spudhead
05-01-2003, 11:39 AM
<hangs head in abject shame>

of course, that would be assuming that I'd checked that the values I'm working with were, in fact, numeric.


Doh.