PHP: check valid ipaddress or CIDR notation range

This function checks for a valid IP address or CIDR notation address range. Example of usage: Recent search terms:https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1831 q_RkxiKb-6BMoW9EPSch9l_6eUTcPTtxAyRpwiOn66k-f6_AZugsUnkqyVYQDY_4 c0cfadabe9dcb932f510036223f86e0c508a4f40&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXmehttps://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1835…