PHP – How can I loop through an array to compare consecutive values including first and last values
The following array contains a list of coordinates that I'm using to draw a polygon with ImageMagick: $points = [ ['x' => 40, 'y' => 10], ['x' => 20, 'y' => 20], ['x' => 70, 'y' => 50], ['x' =>…