Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $partialStates = $_POST['partialState'];
- $whole = file_get_contents('/is/htdocs/xxxxxxxxxxxxx/www/main/wp-content/uploads/jb/res/songs');
- $lines = explode("\n", $whole);
- $sorted = array();
- $c = 0;
- foreach ($lines as $line)
- {
- $sim = similar_text(strtolower($partialStates), strtolower($line), $perc);
- if ($perc > 50)
- {
- $sorted [$c]["percent"] = $perc;
- $sorted [$c]["bandsong"] = $line;
- $c++;
- }
- }
- array_multisort( array_column($sorted, "percent"), SORT_DESC, $sorted );
- foreach ($sorted as $out)
- {
- echo "<div>".$out["bandsong"]."</div>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement