function calculateAreaRect($length, $width) {
    $area = $length * $width;
    return $area;
}
Generate a correct PHP code for the following purpose
Create a function to calculate the area of a rectangle.