Jump to content

Unable to remove line break


patawic

Recommended Posts

<?php

$gamertag = $_GET['gamertag'];

$lines = file("http://www.xboxgamercard.net/testing/index.php?gamertag=$gamertag");

$image = imagecreatefrompng("base.png"); 

$img = imagecreatetruecolor(imagesx($image), imagesy($image));

$watermark = imagecreatefromjpeg("$lines[12]");

 

$base_width = imagesx($image);

$base_height = imagesy($image);

 

$watermark_width = imagesx($watermark); 

$watermark_height = imagesy($watermark);

 

$dest_x = $base_width - $watermark_width - 0; 

$dest_y = $base_height - $watermark_height - 0;

 

imagecopy($img, $image, 0, 0, 0, 0, $base_width, $base_height);

imagecopy($img, $watermark, $dest_x, $dest_y, 10, 10, $watermark_width, $watermark_height);

 

header ("Content-type: image/png");

 

Imagepng ($img);

imagedestroy($img); 

?>

 

Im having an issue with my $lines[12] variable, the url works but there is an unwanted line break at the end of the file. causing this error http://xboxgamercard.net/testing/image.php?gamertag=immunise.

how can i fix this. ive tried str_replace and strip_tags

Link to comment
https://forums.phpfreaks.com/topic/186392-unable-to-remove-line-break/
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.