New to PHP... Can I get assistance creating this html form and following all 8 exercises below. Need help practicing PHP! If you're unsure on how to do this please let someone with more experience do it. Thanks!
* create a small html form that on the post calls findStrings.php
* add a submit button, you will start building a form and use what's below to build it.
</html>
* create a textarea with a label called trim; make sure to put spaces in front and behind your test
* create a text area with a label nl2br (new line to break)
* add html special chars
* when entering in the test in this textarea, make sure to use the enter key to create a break
* create an input type of text with a label called favorite animal
* create an input type of text with a label called favorite state
PHP instructions.
<?php
Match and replace substrings with String functions. Each echo response should be in separate divs or paragraphs.
$extraString = "this is a long string used as an example for finding strings in strings. I AM USING CAPS
AS AN EXAMPLE FOR USING THE NON CASE SENSITIVE OPTIONS. This will Help When You
Need To Search For StrIngs And Do Not Know if someone WiLL be Using CapiTal LEttErs In
WeirD PlAceS or nOt.";
$thisString = "India";
trim ()
**1. capture the trim element's value from your HTML and echo out the string using the trim function; concatinate a pipe in front and behind to
*prove trim works
* when testing place three spaces in front of your test string in the input, but when you echo it, concatenate
*// a pipe in front to show the three spaces were stripped. Front and back space removal works with trim
"|"
echo '<br /><br />';
**2. capture the nl2br element's value and echo it out using that function; see the breaks that are converted from new line characters
*make sure when testing to enter to create a new line - hit the enter key to see what the new line gets converted to
echo '<br /><br />';
**3. create a simple string of 6 colors (make them all lowercase),
choose a special character (!@#$%^&*) and place that character between all of the colors
*explode the colors into another variable, using the explode () function - this will create an array
*using a simple for loop write out all 6 colors in separate list items in an unordered list
*to find out the number of array items, use the function count - this is like length in JavaScript;
*using the strtoupper () function change all of the colors from lowercase to uppercase before writing them to the screen
* in each list item, use your style attribute to make the text color the color of the word. do not use white.
echo '<br /><br />';
**4. using the string above $extraString create a substring (you may need to use this function multiple times and concatinate)
* that when you echo to the screen it says 'an example For Using strings in strings'.
*ALL OF THESE ARE USED IN THE STRING ABOVE Capitalization is important!
echo substr($extraString, 20, 10);
echo '<br /><br />';
**5. capture the favorite animal element's value from your HTML and compare it to $extraString. What must you do to the string the user enters
*in order for it to match $exteaString no matter what capitalization is used.
*If the user enters India then echo 'happy day' else echo 'I like (what the user entered) too!'
* remember string compare is backwards to what you think it might be
echo '<br /><br />';
**6. echo the length of $extraString using strlen()
echo '<br /><br />';
**7. create a simple if statement and let's use the strstr function. if the user enters the word center into the text box
*return an h3 to the screen that says 'You are in the center of the screen'
*if the user does not enter center, return another string like 'Sad!'
echo '<br /><br />';
**8. replace the word someone in $extraString with 'technical superhero' and echo $extraString to the screen
?>