can "input" resolve a variable

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
yusef88
Posts: 1126
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

can "input" resolve a variable

Post by yusef88 »

Code: Select all

  $a = "test";
  $s = input("", "",""); // input $a
  echo $s;
can the "input" command resolve the variable $a ?

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: can "input" resolve a variable

Post by highend »

No, eval() is necessary for doing such a thing

Code: Select all

  $a = "test";
  $s = input("", "", '$a');
  echo eval($s);
One of my scripts helped you out? Please donate via Paypal

yusef88
Posts: 1126
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: can "input" resolve a variable

Post by yusef88 »

Thanks for help

Code: Select all

echo get("shift")
is it possible to get control key also?

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: can "input" resolve a variable

Post by Filehero »

yusef88 wrote: 29 Jan 2019 16:15 is it possible to get control key also?

Code: Select all

<get "shift"> == 2

yusef88
Posts: 1126
Joined: 28 Jan 2013 03:50
Location: Windows 8.1 32-bit

Re: can "input" resolve a variable

Post by yusef88 »

@Filehero
thanks :tup:

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: can "input" resolve a variable

Post by PeterH »

Shorter for eval($s) is *$s

But look out: in both cases $s should contain a valid variable name!

Edit: replaced must by should :whistle:
Win11 Pro 223H2 Gerrman

Post Reply