Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', 1);
- ini_set('log_errors', 1);
- ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
- error_reporting(E_ALL);
- $filename = "wordlist.txt";
- $inputwords = "site.txt";
- $real = "";
- $break = "a";
- // input
- //$tempchar2 = str_split($word);
- //sort($tempchar2);
- //$word = implode($tempchar2);
- // Array for wordlist
- $words = fopen($filename, "r");
- $array = explode("\n", fread($words, filesize($filename)));
- // Array for the words given
- $input = fopen($inputwords, "r");
- $inputarray = explode("\n", fread($input, filesize($inputwords)));
- //print $array["1"];
- for ($a = 0; $a < count($inputarray); $a++) {
- //print $inputarray["$a"];
- $word = sortword($inputarray[$a]);
- // echo $word + " \n";
- for ($i = 0; $i < count($array); $i++) {
- // Takes in the word, breaks into array, sorts and sets a string
- $wordlist_word = sortword($array[$i]);
- echo $wordlist_word;
- if ($wordlist_word == $word) {
- $real = $real + $array[$i];
- $i = count($array);
- }
- print $real;
- function sortword($input){
- echo $input;
- fArray = str_split($input);
- print_r($input);
- sort($fArray);
- unset($fArray);
- sort($fArray);
- $output = implode($fArray);
- return $output;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement