Must be done in PHP. Details below:
NOTE: in #4 part B, the split function that my teacher wants me to use in this program is: str_split()
<?php $s_months = "wi_january_31:wi_february_28:sp_march_31:sp_april_30:sp_may_31:su_june_30:su_july_31:su_august_31:fa_september_30:fa_october_31:fa_november_30:wi_december_31"; //-- Created an array with season $a_seasons = array("wi"=>"winter", "sp"=>"spring", "su"=>"summer", "fa"=>"fall"); //-- split it in to an array $months = split(":", $s_months); ?> <html> <head> <title>String Manipulation Functions</title> </head> <body> <h1>String Manipulation Functions</h1> <?php foreach($months as $keys=>$values) { $a_calenders = split("_", $values); if (!empty($a_calenders)) { //Swapping array elements in order to get month name. $temp = $a_calenders[0]; $a_calenders[0] = $a_calenders[1]; $a_calenders[1] = $temp; foreach($a_calenders as $k=>$v) { ?> <ul> <?php if($k == 0){ ?><li><?php echo ucfirst($v); ?> </li> <?php } ?> <?php if($k == 1 and array_key_exists($v, $a_seasons)){ ?><li style="list-style-position: inside; text-align: inherit;"><?php echo "Season: ".ucfirst($a_seasons[$v]); ?> </li> <?php } ?> <?php if($k == 2){ ?><li style="list-style-position: inside; text-align: inherit;"><?php echo "Number of Days: ".ucfirst($v); ?> </li> <?php } ?> </ul> <?php } } } ?> </body> </html>
Sample Output:
.... and so on.
Note: You can't use str_split() method for string delimiter. it accept only length i.e integer should be used for 2 paramter. Syntax: str_split(stringvariable, length). Eg: str_split($str, 2). Here delimiter is string (:) not an interger.
So i used split() method is the one type of string function.
Must be done in PHP. Details below: NOTE: in #4 part B, the split function that...
<!DOCTYPE html> <html> <head> <!-- JavaScript 6th Edition Chapter 8 Hands-on Project 8-1 Author: Date: Filename: index.htm --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>Hands-on Project 8-1</title> <link rel="stylesheet" href="styles.css" /> <script src="modernizr.custom.65897.js"></script> </head> <body> <header> <h1> Hands-on Project 8-1 </h1> </header> <article> <h2>New Account Information</h2> <form> <fieldset id="deliveryinfo"> <label for="fnameinput">First Name</label> <input type="text" id="fnameinput" name="fname" /> <label for="lnameinput">Last Name</label> <input type="text" id="lnameinput" name="lname" /> <label for="addrinput">Street Address</label> <input type="text" id="addrinput" name="address" /> <label for="cityinput">City</label> <input type="text" id="cityinput" name="city"...
NEED HELP with HTML with Javascript embedding for form validation project below. I have my code below but I'm stuck with validation. If anyone can fix it, I'd really appreciate. ****************************************************************************** CODE: <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Nice</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> var textFromTextArea; function getWords(){ var text =...
Assignment Overview In Part 1 of this assignment, you will write a main program and several classes to create and print a small database of baseball player data. The assignment has been split into two parts to encourage you to code your program in an incremental fashion, a technique that will be increasingly important as the semester goes on. Purpose This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of...
i need help with a mips program to to covert roman numerals to real numbers Lab 4: Roman Numeral Conversion Part A: Due Sunday, 19 May 2019, 11:59 PM Due Friday, 24 May 2019, 11:59 PM Part B: Minimum Submission Requirements Ensure that your Lab4 folder contains the following files (note the capitalization convention): o Diagram.pdf o Lab4. asm O README.txt Commit and push your repository Lab Objective In this lab, you will develop a more detailed understanding of how...