public function configureAnswers(AnswerBuilder $builder)
    {
        $builder->addAnswer(<<<EOF
```
HTTP/1.1 302 Found
Location: /thanks.php

<h1>Thanks for adding a new toy!</h1>
```
EOF
)->addAnswer(<<<EOF
```
HTTP/1.1 302 Found
Location: /thanks.php
```
EOF
, true)->addAnswer(<<<EOF
```
GET /new_toy.php
Host: localhost:8000

<h1>Add a new toy</h1>
```
EOF
)->addAnswer(<<<EOF
```
POST /new_toy.php
Location: /new_toy.php
```
EOF
);
    }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('`json_encode($toys, JSON_PRETTY_PRINT);`', true)->addAnswer("`json_encode(\$toys, 'JSON_PRETTY_PRINT');`")->addAnswer('`json_encode($toys, $JSON_PRETTY_PRINT);`')->addAnswer('`json_encode($toys, JSON_PRETTY_PRINT());`');
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('Trick question! This will have an error!')->addAnswer('MOLLY the dog!')->addAnswer('Molly the dog', true)->addAnswer('MOLLY the dog');
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('There\'s not much difference: both do basically the same thing.', true)->addAnswer('`array_key_exists` returns false if a key does not exist on an array. But `isset()` returns a warning in this case.')->addAnswer('`array_key_exists` can be used on all arrays, but `isset` can only be used with associative arrays');
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('This code has no issues. Well done!', true)->addAnswer('This code will have an error: it\'s missing the closing `?>` at the bottom')->addAnswer('This code has no error, but it *should* have a `?>` at the bottom')->addAnswer('This code will have an error, because you can\'t put a comment at the bottom of the file');
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('To guide the request to the correct server')->addAnswer('To turn a domain name into an IP address', true)->addAnswer('To listen on a port for a request')->addAnswer('To pass the request to the web server');
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('<PHP')->addAnswer('<?php', true)->addAnswer('?>')->addAnswer('echo');
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('!lerriuqs')->addAnswer('!lerraaiuqs')->addAnswer('!leraauqs', true)->addAnswer('lerriauqs');
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('echo $brands[\'Puppy Gruel\']')->addAnswer('echo $brands(4)')->addAnswer('echo $brands[4]')->addAnswer('echo $brands[3]', true);
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer(0)->addAnswer(3, true)->addAnswer(4)->addAnswer('Bear');
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('This would print `engage` in the `<header>` tag', true)->addAnswer('This would cause an error: the `$secretWord` variable is defined in `index.php`, not in `header.php`')->addAnswer('There would be no error, but nothing would print inside the `<header>` tag');
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('Redirecting prevents the user from accidentally re-submitting the form', true)->addAnswer('POST requests (which most form submits are) cannot have responses with content, so we need to redirect to another page')->addAnswer('Redirecting prevents the form from being re-populated with the same data')->addAnswer('Some older browsers cannot properly handle a form submit, unless it redirects');
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('Encodes JSON into a PHP array')->addAnswer('Encodes a PHP array into JSON', true)->addAnswer('Reads a JSON file and sets it into a PHP array');
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('to print things out', true)->addAnswer('to exit HTML mode and enter PHP mode')->addAnswer('to end the file')->addAnswer('to create a variable');
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('The user just browsed to this page, and the form will be pre-filled with the data on the last line.')->addAnswer('The user surfed to `/pets_new.php` and submitted a form. The data on the bottom is what they filled in for the form fields.')->addAnswer('The user just performed a search for all pets named "Waggy Pig" and breed "bichon"')->addAnswer('The user just submitted a form  with `<form action="/pets_new.php" method="POST">`and the data on the bottom is what they filled in for the form fields.', true);
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('POST is used when the user needs to send data. GET is used when a user just wants to fetch a page')->addAnswer('A GET request cannot send any data (i.e. filled-in form fields)', true)->addAnswer('After making both GET and POST requests, the server sends back a response (often the next HTML page to display)')->addAnswer('There\'s no *real* difference between GET and POST requests: both can send data, both cause a response to be returned, but *typically* POST is used to send data.');
 }
 public function configureAnswers(AnswerBuilder $builder)
 {
     $builder->addAnswer('The request cannot be completed because there is no filename (e.g. `index.php`) in the URL')->addAnswer('The request uses the DNS to find the IP address of a remote computer, knocks on the door of port 8000, and then executes and returns index.php')->addAnswer('The request leaves via port 8000 on my computer, but then routes back to my computer and executes index.php')->addAnswer('The request routes back to port 8000 on my local computer and `index.php` is executed and returned', true);
 }