$value) { $transposed = strrpos(CODE, $value); $id += 10 ** (3 - $key) * ($transposed % 10); } return $id; } function get_current_guid_from_historical_id_for($conn, $article_type, $hist_id) { $guid = ""; $query = <<