It sounds like you want PHP's eval function, which executes a string containing PHP code. For example:
// Now
$get_results = '$this->model_db->get_results(' . intval($id) . ');';
// Later
eval($get_results);
However, eval is usually a bad idea. That is to say, there are much better ways to do things you might think to do with eval.
In the example above, you have to make sure $this is in scope in the code calling eval. This means if you try to eval($get_results) in a completely different part of the code, you might get an error about $this or $this->model_db not existing.
A more robust alternative would be to create an anonymous function (available in PHP 5.3 and up):
// Now
$that = $this;
$get_results = function() use ($that, $id) {
return $that->model_db->get_results($id);
};
// Later
call_user_func($get_results);
But what if $this isn't available right now? Simple: make it a function parameter:
// Now
$get_results = function($that) use ($id) {
return $that->model_db->get_results($id);
};
// Later
call_user_func($get_results, $this);
evalis a solution for your task - you definitely doing it wrong