Page 1 of 1

Using function outputstring as multiple input

Posted: Fri Nov 05, 2010 2:05 am
by burgerr
Hi there. Perhaps tiring question from a newbie.

Is it possible to use an output string from one function as an input for another function?

example i'm converting a color hex code to rbg values an use the as multiple input for anoher function.
$hexshizzle = "#006600";
setrgbcolor(hex2rgb($hexshizzle));
input needed is setrgb(0, 102, 0) //numeric values
output from hex2rgb is "0,102,0"

is this a valid construction? it does not seem to work.

Regards,
Rutger

Re: Using function outputstring as multiple input

Posted: Fri Nov 05, 2010 9:44 am
by AbraCadaver
What do you mean by "output", hex2rgb() actually echos those values to the screen? You would be better to return an array of the three values from hex2rgb() and pass that to setrgbcolor(). There are other ways but they will be hackish.