Hiya!
I'm new here
I'm struggling to find out if it's possible to call a function from within a variable. I'll show you what I mean:
<?php
function MyAds($arg)
{
$openads = file("$arg/ads.txt");
$selectedad = $openads[rand(0, count($openads) - 1)];
$selectedad = trim($selectedad);
echo "$selectedad";
}
$adcategory = "Games";
$gamesad1 = "Here is the ad MyAds($adcategory)";
echo $gamesad1;
?>
I know this doesn't work, but is there another way around it? Is there some way I can call a function with an echo? eg.
echo "Here is the ad MyAds($adcategory)";
Any help would be greatly appreciated!
Matt