How to know if Canvas resizes

Is there any way to detect the change in canvas re-sizing, any function that handles that

Haven’t used GD in a while, but I think that there was a function/expression that returned screen/canvas width and height. So just save default one to variable upon game’s launch and compare against it.

I think so this function handler canvas resize on window change