Parse error: syntax error, unexpected - LDAP
<p>I am trying to load the LDAP plugin for the <a href="http://www.question2answer.org/addons.php" rel="nofollow">http://www.question2answer.org/addons.php</a> page.<br>
LDAP plugin here: <a href="https://github.com/zakkak/qa-ldap-login/blob/master/README.md" rel="nofollow">https://github.com/zakkak/qa-ldap-login/blob/master/README.md</a>.</p>

<p>Following the directions from the Readme, I am getting the following errors:</p>

<p>Parse error: syntax error, unexpected '[' in C:\UniServer\www\qa-lab\qa-plugin\qa-ldap-login-master\ldap-login.php on line 30</p>

<p>Here is a copy of the ldap-login.php file.<br>
Line 30 is:
$username = explode("@", $email)[0];</p>

<pre><code>&lt;?php

    class ldap_login {

      function load_module($directory, $urltoroot)
      {
        $this-&gt;directory=$directory;
        $this-&gt;urltoroot=$urltoroot;
      } // end function load_module

      // check_login checks to see if user is already logged in by looking for
      // a cookie or session variable (dependent on 'remember me' setting
      function check_login()
      {
        if(!isset($_COOKIE["qa-login_fname"]) &amp;&amp; !isset($_SESSION["qa-login_fname"])) {
          return false;
        } else {
          if(isset($_COOKIE["bdops-login_fname"])){
            $fname = $_COOKIE["qa-login_fname"];
            $lname = $_COOKIE["qa-login_lname"];
            $email = $_COOKIE["qa-login_email"];
          } else {
            $fname = $_SESSION["qa-login_fname"];
            $lname = $_SESSION["qa-login_lname"];
            $email = $_SESSION["qa-login_email"];
          }
          $source = 'ldap';
          $identifier = $email;

          $username = explode("@", $email)[0];
          $fields['email'] = $email;
          $fields['confirmed'] = true;
          $fields['handle'] = $username;
          $fields['name'] = $fname . " " . $lname;
          qa_log_in_external_user($source,$identifier,$fields);
        }
      } // end function check_login

      function match_source($source)
      {
        return $source=='ldap';
      } // end function match_source

      function login_html($tourl, $context)
      {

      } // end function login_html

      function logout_html ($tourl)
      {
        require_once QA_INCLUDE_DIR."qa-base.php";

        $_SESSION['logout_url'] = $tourl;
        $logout_url = qa_path('auth/logout', null, qa_path_to_root());
        echo('&lt;a href="'.$logout_url.'"&gt;'.qa_lang_html('main/nav_logout').'&lt;/a&gt;');
      } // end function logout_html

    } // end class ldap_login

    ?&gt;
</code></pre>

<p>I should also include, the ldap info I used:</p>

<pre><code>        &lt;?php

    $ldap_search_strings = array( 'uid=myusername,ou=users,ou=hq,dc=domain.net,dc=com');
    $ldap_hostname = 'ldap://ldap.domain.net'; // use ldap:// for non ssl encrypted servers
    $ldap_port = 389; // use 389 for non ssl encrypted servers

    ?&gt;
</code></pre>
