Hi,
Saturday, August 23, 2003, 10:01:54 PM, you wrote:
MW> Hallo Tom,
MW> am Samstag, 23. August 2003 um 05:14 hast Du Folgendes gekritzelt:
TR>> This should do it:
TR>> eval('${"content".$databasepagename}[$i]();');
MW> I'm afraid to say it, but it does not :-(
MW> Yesterday I was also trying to find some manual pages about eval()
MW> which would explain me the syntax. The example in the PHP-Manual is
MW> not meaning much to me.
MW> How can I print out what eval would evaluate, so I can see how to
MW> compose the string?
MW> Thx for answering again ;-)
MW> SvT
This works for me, what error message do you get? Make sure you use
single quotes in the eval otherwise the string will get substituted
before eval gets a look at it.
<?php
$contentarray = array(1=>'testpage');
function testpage(){
echo 'Test succceeded <br>';
}
$i = 1;
$databasepagename = 'array';
eval('${"content".$databasepagename}[$i]();');
?>
--
regards,
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php