1

Well, this is what I have right now.

$bg = imagecreatefrompng('bg.png');

$font = "font.ttf";

$white = imagecolorallocate($bg, 255, 255, 255);
header("Content-type: image/png");
imagettftext($bg, 25, 0, 5, 83, $white, $font, date('d.m.Y'));
imagettftext($bg, 30, 0, 5, 145, $white, $font, date('H:i'));

imagepng($bg);
imagedestroy($bg);

I would like to know how can I actually save created image. I was trying to do something like that:

imagepng($bg,"/users/user/");

To save is but it doesn't work at all. So can anybody tell me how to save image?

Thank you.

2
  • you need too add a file name Commented Mar 17, 2015 at 22:33
  • So how should It look like? Commented Mar 17, 2015 at 22:37

1 Answer 1

1

Give this a shot:

imagepng($bg, "/users/user/bg.png");
imagedestroy($bg);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.