I want to to require only the (functions, classes, variables) from another PHP file but that file have some html content which I don't want.
I already tried require, include, INCLUDE_ONCE, REQUIRE_ONCE but none worked
As the comments suggested, the best way is to reorganize the code so you don't mix functions and HTML in the include file.
But if you really need to do this, you can do it with the output buffering functions.
ob_start();
require 'filename.php';
ob_end_clean();
functions.phpand just include that where it is needed.