PHP file_get_contents usage

Below is a standard command in PHP to get contents of a file in a string variable. file_get_contents($url) Lot of people might wonder why would you get contents of a file in a string if you can get the contents using a simple Include statement. I would like to add that it is not just about getting the content but also converting the content or processing it as per your requirements. file_get_contents is a powerful tool and you can do a lot of things with it. I have only listed a few of them which I have tried using in my project. Evaluating PHP code within the file I have a CMS environment which does not execute a PHP code. I used the CMS to store my PHP code and used file_get_contents() to get the file contents in a string variable and then execute the file as PHP using the below method. [crayon-59c674a2bf4b5402799711/] The above code first converts the file contents in a string and then executes the...
Read More