0

I want to create a graph using GD in PHP, however, lots of things seem to work different ?? in PHP after the

<?php   
header ('Content-Type: image/gif');

statement I cannot use r_print, it seems that GLOBAL is not working for declaration i functions....

if i then delclare like

$x = 1;

and try to use it as

function err($somevare) {
    GLOBAL $x;

it wont work, and using like

r_print ($someOther);

will also crash picture as not renderable

so my question, there seem to be limitations using GD -- image and rest of PHP, where can I understand this better; would appreciate some help (using PHP 5.2 .... yes I know its old)

Georg
  • 1
  • 1
  • Does this answer your question? [How to fix "Headers already sent" error in PHP](https://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php) – AymDev Apr 05 '22 at 12:25
  • oK, sorry,, one solved; I read at several places that "variables were global in general", but "in case you want to ALTER value you need to declare it GLOBAL", well that seem to be false; even to read /use variable it need to be declared GLOBAL (which would be natural). The r_print() is still unresolved why it cannot be used. – Georg Apr 05 '22 at 12:44

0 Answers0