below is some code I am using to \"translate\" a map array into SQL code so I can easily update my database when I have updated my game map. As you can see it prints out the
There is an even simpler approach:
ob_start(); # Your code here ... file_put_contents('yourfile.txt', ob_get_clean());