title: How to save Php variable every 5 minutes without database
body: <p>On my website there is a php function <code>func1()</code>,  which gets some info from other resources. It is very costly to run this function.</p>
  
  <p>I want that when Visitor1 comes to my website then this <code>func1()</code> is executed and the value is stored in <code>$variable1=func1();</code> in a text file (or something, but not a database).</p>
  
  <p>Then a time interval of 5 min starts and when during this interval Visitor2 visits my website then he gets the value from the text file without calling the function <code>func1()</code>.</p>
  
  <p>When Visitor3 comes in 20 min, the function should be used again and store the new value for 5 minutes.</p>
  
  <p>How to make it? A small working example would be nice.</p>