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
https://forums.phpfreaks.com/topic/292064-php-noob-need-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.