Jump to content

[SOLVED] Variables?


phpcodec

Recommended Posts

I have some variables like this:

 

$test1 = '1';

$test2 = '2';

$test3 = '3';

$test4 = '4';

 

and the url was http://www.somewebsites.com/index.php?word=test3

 

I tried:

 

$var = $_GET['word'];

echo $$var;

 

so in theory it should echo 3 or if the url was word=test2 it would echo 2

 

but it does not do this, how can i solve this?

Link to comment
https://forums.phpfreaks.com/topic/112831-solved-variables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.