SyntaxError: Unexpected token var

Explanation

Code Editor

Introduction

Intruction main para goes here.

Intruction para 2 goes here.

Intruction para 3 goes here.

Instructions

This area shows the instructions to be followed.

  • Instruction 1
  • Instruction 2
  • Instruction 3
  • Instruction 4
  • Stuck Get a hint!

    Hint intro here.

    Important hint text goes here.

    More hint info goes here.

    function sanitize($user_input) {
    $x = htmlspecialchars(trim($user_input));
    return $x;
    }

    function sanitize($user_input) { $x = htmlspecialchars(trim($user_input)); return "<span title='".$x."'>User input added as span title </span>"; }

    Reset Code

    Line number