title: Format DateInterval as ISO8601
body: <p>I am currently working on a php project and need to format a DateInterval as ISO8601 (something like this):</p>
  
  <pre><code>P5D
  </code></pre>
  
  <p>This format can be used to create DateTime and DateInterval objects, but I can't figure out a way to format a DateInterval into this format. Is there any? If not, what might be a lightweight solution to that?</p>