How can PHP functions be utilized to streamline code and improve efficiency?

Using PHP functions can help streamline code by encapsulating repetitive tasks into reusable blocks of code. This not only makes the code more organized and easier to read but also improves efficiency by reducing the need to rewrite the same logic multiple times.

// Example of using a function to calculate the area of a rectangle
function calculateRectangleArea($length, $width) {
    return $length * $width;
}

// Call the function to calculate the area of a rectangle
$area = calculateRectangleArea(5, 10);
echo "The area of the rectangle is: " . $area;