THT Community

Full Version: Add this to the $main or a class. Please.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Okay, so I just wanted to tell Jonny (tomorrow is Christmas eve. I won't be here) to add this function to the class. Why? I wanna convert Integer values (1/0) to strings (Yes/no). Just for the ACP Dashboard.

PHP Code:
public function cleaninteger($var){ # Transforms an Integer Value (1/0) to a Friendly version (Yes/No)
     
$patterns[0] = '/0/';
         
$patterns[1] = '/1/';
         
$replacements[0] = 'No';
         
$replacements[1] = 'Yes';
         return 
preg_replace($patterns$replacements$var);
     } 

Add it to the class Jonny Wink Add it