$func = 'createimagefrom' . $ext; $img = $func('mi_imagen.png'); $func = 'image' . $ext; $func($img); // OK