I have the code below that is suppose to randomly pick a different Google api upon getting a video request from the Youtube api. My script gets video data and puts the videos on a Wordpress site. The code below is giving me this error.
syntax error, unexpected '$apiKeys' (T_VARIABLE), expecting function (T_FUNCTION) or const (T_CONST)
Here is my code.
$apiKeys = array(
'AIzaSyDLszH3Dlpiu2ANEbL0SNZmiKJoArZ0000',
'AIzaSyDLszH3Dlpiu2ANEbL0SNZmiKJoArZ0000',
'AIzaSyDLszH3Dlpiu2ANEbL0SNZmiKJoArZ0000',
'AIzaSyDLszH3Dlpiu2ANEbL0SNZmiKJoArZ0000',
'AIzaSyDLszH3Dlpiu2ANEbL0SNZmiKJoArZ0000',
'AIzaSyDLszH3Dlpiu2ANEbL0SNZmiKJoArZ0000');
$rand = rand(0,4);
private $google_api_key = $apiKeys[$rand];
Can someone help me figure out why I’m getting this error? Thank you.