Jump to content

Help


moon 111

Recommended Posts

I have some code that displays all of the files in the directory as an image. What I want it to do is show all of the files in the directory not where the image is located but where it is being called (via image tag).

 

<?php
// create a 100*30 image
$im = imagecreate(300, 300);

// white background and blue text
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);

// write the string at the top left
$arr = scandir('.');
$i = 5;

foreach($arr as $value)
{
  imagestring($im, 2, 0, $i, $value, $textcolor);
  $i = $i+10;
}

// output the image
header("Content-type: image/png");
imagepng($im);
?> 

 

How could I do that?

Thanks

Link to comment
https://forums.phpfreaks.com/topic/99141-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.