Unless strings.php contains any more wrapping code $txt is a global variable.
Php does not allow access to normal global variables from within functions and methods unless explicitly declared.
http://php.net/manual/en/language.variables.scope.php
You call it by first declaring it in the function
class MyClass{
public function MyMethod() {
{
global $txt;
echo $txt['fddf'];
This is a citation from php.net
<?php
$a = 1; /* global scope */
function test()
{
echo $a; /* reference to local scope variable */
}
test();
?>
This script will not produce any output because the echo statement refers to a local version of the $a variable