PHP Classes

File: tutorial.txt

Recommend this page to a friend!
  Classes of Max Udaskin   String Obscure   tutorial.txt   Download  
File: tutorial.txt
Role: Documentation
Content type: text/plain
Description: A tutorial file
Class: String Obscure
Obfuscate text strings by changing some characters
Author: By
Last change: Updated examples
Date: 13 years ago
Size: 1,823 bytes
 

Contents

Class file image Download
This file was written by Max Udaskin. max.udaskin@gmail.com ------------------------------------------------ Installation ------------------------------------------------ 1. Upload to your server 2. Include class into the file you want to use it in 3. Call the function you want (see functions) ------------------------------------------------ Functions ------------------------------------------------ obscure($string, $num_to_obscure = -1, $obscure_char = '*') Takes a string and changes some characters to obscure it @param string $string // The string to obscure @param int $num_to_obscure The number of characters in the string to obscure @param string $obscure_char The string to obscure with (can be more than one character long) obscurePercentage($string, $pct_to_obscure = -1, $obscure_char = '*') Takes a string and changes some characters to obscure it using a percentage of the string length @param string $string // The string to obscure @param int $pct_to_obscure The percentage of characters in the string to obscure @param string $obscure_char The string to obscure with (can be more than one character long) ------------------------------------------------ Examples ------------------------------------------------ echo $str; // Outputs string, unaltered echo stringObscure::obscure($str); // Outputs string with half of the characters obscured echo stringObscure::obscure($str, 10); // Outputs string with ten of the characters obscured echo stringObscure::obscure($str, 7, '-'); // Outputs string with seven of the characters changed to - echo stringObscure::obscurePercentage($str, 25); // Outputs string with 25 percent of the characters obscured