Why does imagecreatefrompng expect a file name instead of a PHP script when loading an image?

`imagecreatefrompng` expects a file name instead of a PHP script because it is a function that reads image data from a file in PNG format. To load an image using `imagecreatefrompng`, you need to provide the path to the PNG file on the server. If you want to dynamically generate an image using PHP code, you can use functions like `imagecreatetruecolor` and `imagepng` to create and output the image.

// Example of dynamically creating and outputting a PNG image
$width = 200;
$height = 200;

$image = imagecreatetruecolor($width, $height);
$bgColor = imagecolorallocate($image, 255, 255, 255);
$textColor = imagecolorallocate($image, 0, 0, 0);

imagestring($image, 5, 50, 50, 'Hello, World!', $textColor);

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