|  | Posted by Vince Morgan on 04/15/07 07:26 
"J.O. Aho" <user@example.net> wrote in messagenews:58dq4bF2gg80nU1@mid.individual.net...
 > It's mainly used to tell what is a variable in a string, say you have a
 > variable called $hell and you have the following
 >
 > echo "$hellohm's";
 >
 > this would try to use the variable $hellohm, which most likely would be an
 > empty variable and result in a string: 's
 >
 > echo "{$hell}ohm's";
 >
 > this would use the value of $hell and add ohm's after the value.
 >
 > The brackets works outside string too, even if it's not that nice looking
 IMHO.
 >
 > In the last line ${$val} is the same as $$val, which makes that the value
 of
 > $val is used as a variable name, say you
 >
 > $hello=5;
 > $val="hello";
 > echo $$val; //will echo the $hello value
 >
 >
 > --
 >
 >   //Aho
 Thank you very much indeed.
 I think your IMHO is a very valid HO ;)
 The revs have reduced a little, but my head is still spinning.
 Regards,
 Vince
  Navigation: [Reply to this message] |