From the course: PHP Practice Challenges
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Generate a form from an array of values
From the course: PHP Practice Challenges
Generate a form from an array of values
- [Instructor] Writing a form can be tedious and repetitive. But what if you had a PHP function that generated the form for you? That's what you'll build in this challenge. Here are the requirements. You'll be provided with an array that can be used to build a form. I want you to analyze the array and make sure you understand how it works, how it is built, and how the form will come together. Then create a function built form that's actually provided for you already that accepts an array to process the form. The function should return the markup for the form. We're not printing the form on the fly. We are returning the complete markup in a string. Then you can print the markup into the provided HTML file. You may also add helper functions if needed. I decided to add a couple, but again, every solution is different, so yours will be different from mine. And that's okay. Pause the video here, then let's get to the solution. Okay, so let's get into the solution. Here is the provided…
Contents
-
-
-
Event capacity: Compare two numbers3m 18s
-
(Locked)
Flip a coin2m 40s
-
(Locked)
High card6m 22s
-
(Locked)
Fizz Buzz3m 53s
-
(Locked)
Given a birth date, determine age3m 54s
-
(Locked)
Determine who's older: Comparing objects4m 13s
-
(Locked)
Sort people by age: Sorting an array of objects5m 35s
-
(Locked)
Extend a class6m 17s
-
Process a simple contact form7m 10s
-
(Locked)
Store and retrieve data from a cookie4m 24s
-
(Locked)
Send an email6m 6s
-
(Locked)
Save to a file7m 44s
-
(Locked)
Create functions in a namespace5m 7s
-
(Locked)
Build a calculator form5m 17s
-
(Locked)
Write a number guessing game10m 19s
-
(Locked)
Generate a form from an array of values20m 10s
-
(Locked)
Retrieve and display data from a provided REST API6m 52s
-
(Locked)
The Dutch National Flag Problem4m 13s
-
(Locked)
Convert CSV to JSON5m 10s
-
(Locked)
Encrypt then decrypt a string6m 32s
-
(Locked)
Write a login form8m 7s
-
(Locked)
Search an HTML page for information on it6m 1s
-
(Locked)
Text processor7m 33s
-
(Locked)
Associated words7m 36s
-