Warning: Cannot use a scalar value as an array [fixed]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

Warning: Cannot use a scalar value as an array [fixed]

Post by psychotomus »

whats this error mean?
Warning: Cannot use a scalar value as an array in /mounted-storage/home40b/sub002/sc18478-RGIJ/simsportal.net/myaccount/settings.php

shows this error on everyone of these lines.

Code: Select all

//set settings
		$settings[] = $settings->popup_on_new_msg;
		$settings[] = $setting->email_on_new_msg;
		$settings[] = $setting->popup_on_lost_highscore;
		$settings[] = $settings->email_on_lost_highscore;
		$settings[] = $settings->popup_friend_invite;
		$settings[] = $settings->email_friend_invite;
		$settings[] = $settings->play_profile_music;
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

$settings is scalar. i.e. it's not an array. It's either an integer, float, string or boolean.
Post Reply