How to put the value written on the face to the outside for use?

suppose I generate a value on some if faces

 $name 

if(xxx==xxx){
    if(xxx==xxx){
        if(xxx==xxx){
            $name = xxx;
        }
    }
}

I want to add $name to the outside of if to use
so what should I do?!

Mar.02,2021
Can't

$name be set as a global variable


var $name;
if(xxx==xxx){
  if(xxx==xxx){
      if(xxx==xxx){
          $name = xxx;
      }
  }
}

I don't quite understand what it means, but I should be able to write it this way:

<?php
function test() {
    global $teee;
    $teee = 1;
}
test();
echo $teee;
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b9ea20-2f412.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b9ea20-2f412.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?