title: How to draw a gradient rectangle in PHP?
body: <p>I want to draw a double gradient like this <img src="https://i.stack.imgur.com/gS4pT.png" alt="gradient"> in PHP (in different colors).</p>
  
  <p><strong>Edit:</strong> Ended up modifying one of the provided gradient functions in the answers to simply draw the double gradient.</p>