When you want to know the amount of fencing needed, you have to find the perimeter of the enclosed space. For the shape of a rectangle, the perimeter is the sum of its sides. Its sides consist of 2 equal lengths and 2 equal widths. Therefore:
A = 2L + 2W = 18(2) + 45(2) = 126 feet
It will need 126 feet of fencing.