Request password

How to get menu content and save it to text file

Whats the php code snippet to get specifig div or ul content from live site and automatically save it to text file, like menu.txt or something?. The savet text file should be raw, like it has all the markup li href etc. I had this snippet before but i lost it when replacing hdd 😩. I need to save Luna forum menu to text file so i canuse jquey to include that in my index page which is plain html page.