IntensE
Power Member
- Aug 19, 2008
- 771
- 661
Hello, I need to make a page like this one: http://mnemotechnics.org/3.1415926/t/words3.php
But I need to do it with words in a different language and also input the number of words to display.
So far, I made this code:
This code displays the words ok, but they are not in a list and I need to make it like the website above with words numbered like:
1. word1
2. word2
3. word-etc
Any help ?
But I need to do it with words in a different language and also input the number of words to display.
So far, I made this code:
Code:
<?php
$filename = $_SERVER["DOCUMENT_ROOT"].'/test/words.txt';
$number = $_POST['number'];
if ($fileContents = file($filename)) {
shuffle($fileContents);
?>
<form action="." method="POST">
<br><br>How many words to show? <input type="text" name="number"><br>
<input type="submit" value=" Enter ">
</form>
<h2>List of words:</h2><br >
<?php
for ($i = 0; $i < $number; $i++) {
print($fileContents[$i]. '<br />');
}
} else {
die('Could not get contents of: ' . $filename);
}
?>
This code displays the words ok, but they are not in a list and I need to make it like the website above with words numbered like:
1. word1
2. word2
3. word-etc
Any help ?