How to use single.php output in function.php

I don’t undesrtand well what you want to do. You mean this??? (the last line):

<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
$content = get_the_content();
$content = apply_filters('the_content', $content);
echo wp_strip_all_tags($content);
$Temp_text=wp_strip_all_tags($content);

do_something($Temp_text);

?>

And implement do_something() inside functions.php