Evaluate String as Object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Is it possible to evaluate a string passed to a script as an object?

If, for example, I have the following executing in my script:

$result = $player_1->execute_query();
// OR
$result = $player_2->execute_query();

If I pass a value to a script in the following manner, say:

$playername = $_GET["playername"];

Can I convert/evaluate this as an object, i.e.:

$result = [VALUE-OF-$playername]->execute_query();

I'd rather not be in a position where I'm doing a raft of if/then
statements....

Cheers,

bub.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux