i'd like to run a php-function dynamically by using this string:
do_lightbox('image1.jpg', 'picture 1')
i've parsed the string like this:
$exe = "do_lightbox";
$pars = "'image1.jpg', 'picture 1'";
and tried using the following code:
$rc = call_user_func($exe, $pars);
unfortunately this gives me an error - i've also tried splitting the $pars like
$pars = explode(',', $pars);
but didn't help ..
any ideas? thanks
I think this is what you're after:
$exe = "do_lightbox";
$pars = array('image1.jpg', 'picture 1');
$rc = call_user_func_array($exe, $pars);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With