- Reading files
- Iterating across a map of keys and values
- Parsing results
- Download a copy of the states.csv file into your exercises/project directory of your choice.
- Use the programming language of your choice to solve the following problems.
| Step 1. | |
| `vagrant ssh` to ssh into your Vagrant VM. | |
| from `/vagrant/sites/` run `composer create-project laravel/laravel {directory} 4.2 --prefer-dist` | |
| name `{directory}` project.dev or mynewsite.dev. | |
| Step 2. | |
| from your `~/vagrant-lamp/` directory on your Mac, run `ansible-playbook ansible/create-vagrant-site.yml` | |
| name the new site exactly as you've named project.dev or mynewsite.dev |
| <?php var_dump($_GET); ?> | |
| <?php var_dump($_POST); ?> | |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>My First Form</title> | |
| </head> |
| <html> | |
| <head> | |
| <title>AJAX Blog</title> | |
| <!-- Latest compiled and minified CSS --> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> | |
| <!-- Optional theme --> | |
| <link rel="stylesheet" type="text/css" href="/css/darkly.css"> |
| Pages: | |
| - | |
| - resume page | |
| - | |
| - | |
| Forms: | |
| Search form | |
| - method="GET" | |
| - must have a label |
~/vagrant-lamp/ directory on your Mac
ansible-playbook ansible/playbooks/vagrant/site/static.ymlyour-github-username.dev` with your GitHub user name.~/vagrant-lamp/sites/your-github-username.dev/publiccss, js, img. Populate them as necessary.In PHP, the $_GET SUPERGLOBAL is an associative array (available anywhere since it's a SUPERGLOBAL) that represents all the key => value pairs contained in the URL's Query String. The URL's query string represents a set of arbitrary key=value pairs that are a critical part fo the interface for your web applications.
Copy and paste this code to the top of your PHP script to see the $_GET array in relation to the Query String after the ? character:
// $_GET is PHP's globally accessible variable that contains any additional key=>value pairs sent with an HTTP GET request from a client
echo "The \$_GET SUPERGLOBAL is: ";
var_dump($_GET);| <?php | |
| class Automobile | |
| { | |
| public $make; | |
| public $model; | |
| public $color; | |
| public $miles; |
| Coding Challenges. Complete these in the language of your choice. | |
| 1. Count the number of Fibonacci numbers in given range. First few Fibonacci | |
| numbers | |
| are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 141, .. | |
| Range is 10 to 100 |
| <?php | |
| switch($projectStatus) { | |
| case 'Payment Received': | |
| if(Input::get('invoice_approval_date') == '' | |
| && Input::get('project_submitted_date') == '' | |
| && Input::get('invoice_submitted_date') == '' | |
| && Input::get('payment_received') == '') { | |
| $project->payment_received = 'Today'; | |
| $project->invoice_approval_date = 'Today'; |