Habe folgenden Quelltext:
	
In meinem ersten Versuch habe ich die Variable $anzahl mit dem 'echo' ausgegeben. Da stand eine '3' drin. Was auch richtig ist!!!!
Dann habe habe ich das 'echo' auskommentiert und dann wollte ich die Variable $anzahl in einer Grafik (png) ausgeben.
Und dann gibt er mir eine '4' aus. Der restliche Quellcode ist unverändert, es kam nur die Bildausgabe dazu.
Wäre schön, wenn jemand hierfür eine Erklärung hätte!
Vielen Dank! Gruß Frank
					PHP-Code:
	
	
//************************
//Leere Zeilen löschen
//************************
//block = In diesem Block steht die Zeile
//line = die endgültige Linie der Angabe
$block = array();
$line = array();
$anzahl = 1;
for ($x = 1; $x < 11; $x++) {
    if ($tmpline[$x] !== "") {
    $line[$anzahl] = $tmpline[$x];
    $block[$anzahl] = $tmpblock[$x];
    $anzahl++;
    }
}
$anzahl = $anzahl - 1;
//echo "Anzahl Zeilen: ".$anzahl." Stueck";
// Preview erstellen
header('Content-type: image/png');
$file = 'bc_service_provider.png';
$new_picture = imagecreatefrompng($file);
$fontfile = 'myrii___.ttf';
$fontsize = 7;
$fontangle = 0;
$text_color = imagecolorallocate($new_picture, 0, 0, 0);
$text = $anzahl;
imagettftext($new_picture, $fontsize, $fontangle, 10, 10, $text_color, $fontfile, $text);
imagepng($new_picture);
imagedestroy($new_picture);
?> 
Dann habe habe ich das 'echo' auskommentiert und dann wollte ich die Variable $anzahl in einer Grafik (png) ausgeben.
Und dann gibt er mir eine '4' aus. Der restliche Quellcode ist unverändert, es kam nur die Bildausgabe dazu.
Wäre schön, wenn jemand hierfür eine Erklärung hätte!
Vielen Dank! Gruß Frank
EDIT: 
PHP-Tags sponsored by Goth.
 
          
 Ich werde wahnsinnig...
									
									
									Ich werde wahnsinnig...
								
 
  
  
  Formulargenerator
 Formulargenerator Herkunftsstatistik
 Herkunftsstatistik Moderator
 Moderator
Kommentar