What function can be used to add content to the beginning of a text file in PHP?

To add content to the beginning of a text file in PHP, you can use the `file_put_contents()` function with the `FILE_APPEND` flag set to `0`. This will allow you to prepend content to the file without overwriting the existing content.

$content = "New content to add\n";
$file = 'example.txt';

$currentContent = file_get_contents($file);
$content .= $currentContent;

file_put_contents($file, $content);