Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.


Using $_GET variables in a Function

In this section we will replicate the same functionality as we did in the previous example by using a function. Fork the Treehouse workspace and preview the workspace to view the code below.

<a class="button primary-blue large" role="button" href="https://teamtreehouse.com/workspaces/u9lwpc54rr/fork&quot;&gt;Fork Workspace</a>

 function greeting() {
    $name = $_GET[&#39;name&#39;];