What PHP extension can be used to draw wave lines?

To draw wave lines in PHP, you can use the GD extension. GD is a graphics library that allows you to create and manipulate images in various formats. By using GD functions, you can easily draw wave lines by creating a series of points and connecting them with lines to form a wave pattern.

<?php
// Create a new image with specified width and height
$image = imagecreatetruecolor(800, 200);

// Set the background color to white
$bgColor = imagecolorallocate($image, 255, 255, 255);
imagefill($image, 0, 0, $bgColor);

// Set the wave line color to blue
$waveColor = imagecolorallocate($image, 0, 0, 255);

// Draw wave lines by connecting a series of points
for ($x = 0; $x < 800; $x += 4) {
    $y = 100 + sin($x / 20) * 50;
    imagesetpixel($image, $x, $y, $waveColor);
}

// Output the image
header('Content-Type: image/png');
imagepng($image);

// Free up memory
imagedestroy($image);
?>