in reply to constant variable using scaler variable

I guess you have a good reason to say $var="A1" instead of $var=A1, so

print(eval($var));
would be one way to solve the problem.

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^2: constant variable using scaler variable
by merlyn (Sage) on Oct 01, 2008 at 17:03 UTC
    That's one way to solve the problem, in the same way that using a flamethrower to light a cigarette is "one way to solve the problem". Not good. Dangerous. Expensive. The other solutions in this thread are far better.

      I dunno, I think using a flamethrower to light a cigarette is a great way to solve the problem of being addicted to cigarettes...

      /me ducks, runs, and hides

      But a pastry torch is a fine way to light a cigar. ;)


      Revolution. Today, 3 O'Clock. Meet behind the monkey bars.

      I would love to change the world, but they won't give me the source code

A reply falls below the community's threshold of quality. You may see it by logging in.