how to get permalink structure with php

I need to make if statements for every permalink structure, so I need to know if there is a function that returns to me the actual selected permalink structure by the user.
To make it simple all I need to know is if this permalink:

www.site.com/?p=22;

a condition will apply else if this structure

www.site.com/cat/title

is used then another condition is applied.

So all I need to know is if there is function in WordPress that can return me what structure the website is using.

Solutions Collecting From Web of "how to get permalink structure with php"