Jump to content

PHP Noob - Need help!


ON7

Recommended Posts

So I'm trying to learn PHP so that I can work with the SteamAPI.

I have previous coding experience (C, Java) and I'm uncertian on why my script isn't working.

 

API: https://github.com/andrewmcwatters/steamweb-php-api

 

Error:

 

Parse error: syntax error, unexpected '[' in index.php on line 51

 

Line 51:

$parameters = ['key' => STEAM_WEB_API_KEY];

From what I've understood, the script is trying to create an array called "parameters" and inside it's trying to create a variable called "key" which is going to hold the constant "STEAM_WEB_API_KEY". This constant is suppose to be loaded from a file called "steamwebapi_config.php" which looks like the following:

<?php
/**
 * Steam Web PHP API
 */

const STEAM_WEB_API_KEY = 'your steam api key that is given by vavle';

I didn't attach my actual key in the script above for obvious reasons.

 

I have no idea how to fix this issue nor what is casuing it.
Again, I'm not experienced with PHP and I'd appreciate any help you guys can give me!

 

Thanks to anyone who helps.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.