What is the purpose of using file_get_contents in PHP to load content from a file into a string?

The purpose of using file_get_contents in PHP is to load the contents of a file into a string variable. This function allows you to easily read the contents of a file and store it in a variable for further processing, such as displaying the contents on a web page or manipulating the data in some way.

// Load content from a file into a string
$file_contents = file_get_contents('example.txt');

// Display the contents of the file
echo $file_contents;