Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add this to the $main or a class. Please.
#1
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
Jimmie Lin - Community Manager & THT.Next Developer


Forum Jump:


Users browsing this thread: 1 Guest(s)