You can use the
file_get_contents() function to load a file into a string and write it's contents.
It doesn't exactly replaces the function with the file, but if your point in question is to have separate PHP file for the plugin logic, and another for the "HTML" page, than this should help.
The following code is enough to response the content of a "HTML" or any other text file rather than echoing from the PHP code. Plugin consists of two files:
Plugin Name: HTML Include Plugin
// register menu item
// add menu item
add_menu_page('HTML Include Plugin', 'HTML Include Plugin', 'manage_options', 'html-include-plugin', 'admin_page');
// write the contents of the HTML file
$file = file_get_contents('hello.html', FILE_USE_INCLUDE_PATH);
if($file == false)
echo 'file not found';
This is a sample HTML content, but this can be any kind of text file...