I have another idea to improve my code. I want to generate a common call to my functions without neede to repeat all.
This question is related with this one :
Php reading object variable as part of other variable
This is my code:
function link_01() {}
function link_02() {}
..
function link_0N() {}
What I cant to do is the following :
$link_name = 'link_0' ;
for($cont=1 ; $cont <= $this->num_links; $cont++)
{
$linkName = sprintf($link_name , $cont) ;
$fieldLink = $this->$linkName ;
$fieldLink($cont) ;
}
This don't work. What's wrong in my code?