How can PHP be used to generate SVG elements like circles?

To generate SVG elements like circles using PHP, you can use the `echo` function to output the SVG code directly from your PHP script. You can define the attributes of the circle, such as its center coordinates, radius, fill color, and stroke color, within the SVG `<circle>` element. By dynamically generating SVG elements with PHP, you can create interactive and visually appealing graphics on the fly.

&lt;?php
header(&#039;Content-Type: image/svg+xml&#039;);

$svg = &#039;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width=&quot;100&quot; height=&quot;100&quot;&gt;&#039;;
$svg .= &#039;&lt;circle cx=&quot;50&quot; cy=&quot;50&quot; r=&quot;40&quot; fill=&quot;red&quot; stroke=&quot;black&quot; /&gt;&#039;;
$svg .= &#039;&lt;/svg&gt;&#039;;

echo $svg;
?&gt;