So , in function 1 i am converting data into a somthing = $myvar , then in another function i am using this and also need to echo it however , i only seem to be able to echo this var in function 1 and in global scopes., i dont want to send it to function2($myvar) because then it will be called twice.
I have defined it globaly but it still doesnt want to be seen in the function 2. The var is made before the other functions are used.

heres a mock-up of what i have , wont post the code as its a mouthful + its easier to see what im trying to explain here.

Function1(){
Global $myvar;
$myvar = "my generated info in this function" ;
}

Function2(){
echo $myvar; // BUT THIS IS NULL / BLANK
}

Echo $myvar; // IT WILL THEN ECHO HERE FINE but not in the function scope
Looking at below answers , thanks by the way.

When i globaly define $myvar which is ahcualy $convertedid in my real code.
It works , i can then echo it globaly

However , when i got into a diffrent function it i cant call / echo it. I have tried everything , even calling global $convertedid then echo $convertedid

The reason i need this in the second function is 1, to display it to the user and it also is the end of the line where my the infomation is whacked into the database then called by other pages