Potresti fare cosi.

codice:
<?php
//--------- Inizio Bufferizzazione dell'HTML 
ob_start();
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>
<body>
thelittle

thelittle

thelittle

thelittle

thelittle

thelittle

</body>
</html>

<?php
//--------- Salvo il contenuto della bufferizzazione
$content = ob_get_contents();
//--------- Fine Bufferizzazione dell'HTML
ob_end_clean();
//--------- Rimpiazzo 
$content = str_replace("thelittle","badaze",$content);
//--------- Stampo a video il nuovo contenuto
print $content;
?>