I’m newbie in PHP, so be kind please! And I’m sorry if it’s too repeated, but my brain is burning. I want to learn how to change the variables using only one function of WordPress.
This is my variables…
function be_comu() {
$name = 'BE';
echo $name;
}
function cn_comu() {
$name = 'CN';
echo $name;
}
function mn_comu() {
$name = 'MN';
echo $name;
}
This is my function and be_comu()
is a variable that I want to change.
function turismo() {
ob_start();
be_comu();
$rota = ob_get_clean();
echo $rota;
}
How to change the result to cn_comu
or mn_comu
without creating a new function?
With call_user_func (PHP is awesome that way):