can "input" resolve a variable

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

can "input" resolve a variable

Post by yusef88 » 29 Jan 2019 13:38

Code: Select all

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

highend
Posts: 8304
Joined: 06 Feb 2011 00:33

Re: can "input" resolve a variable

Post by highend » 29 Jan 2019 13:42

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 or highend (at) web (dot) de

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

Re: can "input" resolve a variable

Post by yusef88 » 29 Jan 2019 16:15

Thanks for help

Code: Select all

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

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

Re: can "input" resolve a variable

Post by Filehero » 29 Jan 2019 16:31

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

Code: Select all

<get "shift"> == 2

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

Re: can "input" resolve a variable

Post by yusef88 » 29 Jan 2019 17:30

@Filehero
thanks :tup:

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

Re: can "input" resolve a variable

Post by PeterH » 29 Jan 2019 17:38

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:
W7(x64) SP1 German
( +WXP SP3 )

Post Reply