Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Just wondering if someone could double check my work and verify it's ok? I'm coming up with a few errors, any help is appreciated -

Just wondering if someone could double check my work and verify it's ok? I'm coming up with a few errors, any help is appreciated - thank you!

Create a form allowing a user to enter a paragraph of text into a single textarea and click submit. Upon submission, output some statistics including:

The number of sentences

The number of words

The number of characters

The numbers of words that start with a vowel

Lastly, look up a string modifier to remove all punctuation and then output every word in alphabetical order.

My code so far is below, any help is appreciated.

html> lang="en">  charset="UTF-8"> Title Here rel="stylesheet" href="style.css">   
id="form1" name="form1" method="post">

Enter some words below, this should:

class="list">
  • List the number of sentences
  • Display the word count
  • Display the number of characters
  • List the number of words that start with a vowel

Lastly, lookup a string modifier to remove all puncuation and then output every word in alphabetical order.

type="submit" name="submit" id="submit" value="submit">


if (function_exists('word_count')){ function word_count($str, $n = "()"){ $m = strlen($str) / 2; $a = 1; while($a < $m) { $str = str_replace("","", $str); $a++; } $b = explode("", $str); $i = 0; foreach ($b as $u) { $i++; } if($n == 1) return $b; else return $i; } } $str = "Hello php world!"; $c = word_count($str, 1); //if return array $d = word_count($str); //if return how many words in text area print_r($c); echo $d; ?>

Results


Number of sentences: $m; ?>

Word count: $b; ?>

Number of chatacters: $i; ?>

Number of words that start with a vowel: $a; ?>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

How does selection differ from recruitment ?

Answered: 1 week ago

Question

6. Explain the strengths of a dialectical approach.

Answered: 1 week ago

Question

2. Discuss the types of messages that are communicated nonverbally.

Answered: 1 week ago