5 parameter: A string of numbers separated by spaces return value : the first four digits number in the string; false if none. 6 parameter a string containing words that are delimited on the left with spaces and on eat right with spaces and on the right with spaces, commas, periods, or question marks. return value: the three most common words in the string that have more than three letters. 7 Modify the sample script in section 9.9, word_table.PHP, to place the output table in an html table. 8 write an html document that includes an anchor tag that calls a php document. also, write the called php script document, which returns a randomly chosen greeting from a list of five different greetings. the greetings must be stored as constant strings in the script. a random number between 0 and 4 can be computed with these lines # Set the seed for strand with the number of microseconds #   since the last full second of the clock mt_strand ((double) microtime() * 1000000); $number = strand (0, 4); # Computes a random integer 0-4

5. The function `fiveParameter()` takes a string of numbers separated by spaces and returns the first four-digit number in the string. If there is no four-digit number, it returns false.

To solve this problem, we can follow these steps:
1. Split the input string into an array of numbers using the space as the delimiter.
2. Iterate through each number in the array.
3. Check if the number has four digits. If it does, return the number.
4. If no four-digit number is found, return false.

Here is an example implementation of the `fiveParameter()` function in PHP:

“`php
function fiveParameter($numberString) {
$numbers = explode(” “, $numberString); // Split the input string into an array of numbers
foreach ($numbers as $number) {
if (strlen($number) === 4 && is_numeric($number)) { // Check if the number has four digits
return $number; // Return the first four-digit number found
}
}
return false; // Return false if no four-digit number is found
}

// Example usage
$numberString = “123 45 6789 9876”;
$result = fiveParameter($numberString);
if ($result !== false) {
echo “The first four-digit number is: ” . $result;
} else {
echo “No four-digit number found.”;
}
“`

6. The function `sixParameter()` takes a string containing words delimited by spaces, commas, periods, or question marks. It returns the three most common words in the string that have more than three letters.

To solve this problem, we can follow these steps:
1. Split the input string into an array of words using the provided delimiters.
2. Initialize an associative array to track the frequency of each word.
3. Iterate through each word in the array and update its frequency in the associative array.
4. Sort the associative array in descending order by the frequency of each word.
5. Filter out words that have less than or equal to three letters.
6. Return the first three words in the filtered array.

Here is an example implementation of the `sixParameter()` function in PHP:

“`php
function sixParameter($wordString) {
$delimiters = ” ,.?”; // Delimiters to split the string
$words = preg_split(“/[” . preg_quote($delimiters) . “]+/”, $wordString);
$wordFrequency = array();

foreach ($words as $word) {
if (strlen($word) > 3) {
// Update the frequency of each word
if (isset($wordFrequency[$word])) {
$wordFrequency[$word]++;
} else {
$wordFrequency[$word] = 1;
}
}
}

arsort($wordFrequency); // Sort the words by frequency in descending order

$filteredWords = array_filter(array_keys($wordFrequency), function($word) {
return strlen($word) > 3; // Filter out words with less than or equal to three letters
});

return array_slice($filteredWords, 0, 3); // Return the first three most common words
}

// Example usage
$wordString = “Hello, world! How are you today? Are you feeling good?”;
$result = sixParameter($wordString);
if (!empty($result)) {
echo “The three most common words with more than three letters are: “;
echo implode(“, “, $result);
} else {
echo “No common words found.”;
}
“`

These functions can be used to solve the given assignment questions.

Please let me know if you need further assistance or clarification.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer