<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PHP : Cannot use a scalar value as an array</title>
	<atom:link href="http://www.lost-in-code.com/platforms/wordpress/php-cannot-use-a-scalar-value-as-an-array/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lost-in-code.com/platforms/wordpress/php-cannot-use-a-scalar-value-as-an-array/</link>
	<description>Web Development Resources</description>
	<lastBuildDate>Mon, 30 Jan 2012 10:42:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Tommy</title>
		<link>http://www.lost-in-code.com/platforms/wordpress/php-cannot-use-a-scalar-value-as-an-array/comment-page-1/#comment-7579</link>
		<dc:creator>Tommy</dc:creator>
		<pubDate>Sun, 19 Jun 2011 19:00:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/2008/02/26/php-cannot-use-a-scalar-value-as-an-array/#comment-7579</guid>
		<description>I have a similar problem with one type of theme (expandable full width artisteer) however only in the backend, when i enter the widget area
a have to scroll down and across to find anything however it all works. this is the warning i get. 


Cannot use a scalar value as an array in /var/www/vhosts/******/httpdocs/wp-content/themes/****_****/core/widgets.php on line 16

  Here is line (16) $controls[&#039;params&#039;][0][&#039;id&#039;]=$id;
gratefull for any help.</description>
		<content:encoded><![CDATA[<p>I have a similar problem with one type of theme (expandable full width artisteer) however only in the backend, when i enter the widget area<br />
a have to scroll down and across to find anything however it all works. this is the warning i get. </p>
<p>Cannot use a scalar value as an array in /var/www/vhosts/******/httpdocs/wp-content/themes/****_****/core/widgets.php on line 16</p>
<p>  Here is line (16) $controls['params'][0]['id']=$id;<br />
gratefull for any help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DS Media</title>
		<link>http://www.lost-in-code.com/platforms/wordpress/php-cannot-use-a-scalar-value-as-an-array/comment-page-1/#comment-7260</link>
		<dc:creator>DS Media</dc:creator>
		<pubDate>Thu, 06 Jan 2011 22:59:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/2008/02/26/php-cannot-use-a-scalar-value-as-an-array/#comment-7260</guid>
		<description>Hello,

Try declaring the array:
$example = array();
$example[] = &#039;somecontent&#039;;
$example[] = &#039;somemorecontent&#039;;</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Try declaring the array:<br />
$example = array();<br />
$example[] = &#8216;somecontent&#8217;;<br />
$example[] = &#8216;somemorecontent&#8217;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark App</title>
		<link>http://www.lost-in-code.com/platforms/wordpress/php-cannot-use-a-scalar-value-as-an-array/comment-page-1/#comment-7070</link>
		<dc:creator>Mark App</dc:creator>
		<pubDate>Thu, 23 Sep 2010 10:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/2008/02/26/php-cannot-use-a-scalar-value-as-an-array/#comment-7070</guid>
		<description>I also am getting this error. Unfortunately I don&#039;t understand any of what has been said above. Here is my error - how to correct?

Warning: Cannot use a scalar value as an array in 
/wp-content/themes/thesis_18b4/lib/classes/options_design.php on line 482

Warning: Cannot use a scalar value as an array in /wp-content/themes/thesis_18b4/lib/classes/options_design.php on line 483

Warning: Cannot modify header information - headers already sent by (output started at 
/wp-content/themes/thesis_18b4/lib/classes/options_design.php:482) in /wp-includes/pluggable.php on line 890</description>
		<content:encoded><![CDATA[<p>I also am getting this error. Unfortunately I don&#8217;t understand any of what has been said above. Here is my error &#8211; how to correct?</p>
<p>Warning: Cannot use a scalar value as an array in<br />
/wp-content/themes/thesis_18b4/lib/classes/options_design.php on line 482</p>
<p>Warning: Cannot use a scalar value as an array in /wp-content/themes/thesis_18b4/lib/classes/options_design.php on line 483</p>
<p>Warning: Cannot modify header information &#8211; headers already sent by (output started at<br />
/wp-content/themes/thesis_18b4/lib/classes/options_design.php:482) in /wp-includes/pluggable.php on line 890</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Memphis Monroe</title>
		<link>http://www.lost-in-code.com/platforms/wordpress/php-cannot-use-a-scalar-value-as-an-array/comment-page-1/#comment-979</link>
		<dc:creator>Memphis Monroe</dc:creator>
		<pubDate>Sun, 02 May 2010 08:57:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/2008/02/26/php-cannot-use-a-scalar-value-as-an-array/#comment-979</guid>
		<description>greetings there, i just saw your site via yahoo, and i would like to comment that you express exceptionally good via your web portal. i am very struck by the way that you compose, and the message is outstanding. anyways, i would also like to know whether you would love to exchange links with my blog? i will be certainly more than willing to reciprocate and put your link off in the blogroll. waiting for your response, i would like to convey my appreciation and enjoy your day!</description>
		<content:encoded><![CDATA[<p>greetings there, i just saw your site via yahoo, and i would like to comment that you express exceptionally good via your web portal. i am very struck by the way that you compose, and the message is outstanding. anyways, i would also like to know whether you would love to exchange links with my blog? i will be certainly more than willing to reciprocate and put your link off in the blogroll. waiting for your response, i would like to convey my appreciation and enjoy your day!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sosh</title>
		<link>http://www.lost-in-code.com/platforms/wordpress/php-cannot-use-a-scalar-value-as-an-array/comment-page-1/#comment-466</link>
		<dc:creator>Sosh</dc:creator>
		<pubDate>Thu, 25 Jun 2009 17:06:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/2008/02/26/php-cannot-use-a-scalar-value-as-an-array/#comment-466</guid>
		<description>I realized that I was getting that same error because I was dumping some form data into an array via:

$cart[&#039;data&#039;] = $_POST;

Besause the $_ vars are of different types it would not allow me to add new varaibles to the $cart[&#039;data&#039;] array, like so:

$cart[&#039;data&#039;][&#039;total&#039;]

Then I changed the code to: 

foreach($_POST as $k =&gt; $v) 
  $cart[&#039;data&#039;][$k] = $v;

That made everything work just fine.</description>
		<content:encoded><![CDATA[<p>I realized that I was getting that same error because I was dumping some form data into an array via:</p>
<p>$cart['data'] = $_POST;</p>
<p>Besause the $_ vars are of different types it would not allow me to add new varaibles to the $cart['data'] array, like so:</p>
<p>$cart['data']['total']</p>
<p>Then I changed the code to: </p>
<p>foreach($_POST as $k =&gt; $v)<br />
  $cart['data'][$k] = $v;</p>
<p>That made everything work just fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SyCo</title>
		<link>http://www.lost-in-code.com/platforms/wordpress/php-cannot-use-a-scalar-value-as-an-array/comment-page-1/#comment-444</link>
		<dc:creator>SyCo</dc:creator>
		<pubDate>Tue, 09 Jun 2009 16:28:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/2008/02/26/php-cannot-use-a-scalar-value-as-an-array/#comment-444</guid>
		<description>Code example removed so here it is again. This will cause the same error.

$foo=0;//int
$foo[]=1;</description>
		<content:encoded><![CDATA[<p>Code example removed so here it is again. This will cause the same error.</p>
<p>$foo=0;//int<br />
$foo[]=1;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SyCo</title>
		<link>http://www.lost-in-code.com/platforms/wordpress/php-cannot-use-a-scalar-value-as-an-array/comment-page-1/#comment-443</link>
		<dc:creator>SyCo</dc:creator>
		<pubDate>Tue, 09 Jun 2009 16:27:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/2008/02/26/php-cannot-use-a-scalar-value-as-an-array/#comment-443</guid>
		<description>The error comes because you are trying to append an array value to a variable. PHP will automatically typecast a variable so you don&#039;t have to declare it&#039;s type but it wont re typecast.

so
 


will cause this error.</description>
		<content:encoded><![CDATA[<p>The error comes because you are trying to append an array value to a variable. PHP will automatically typecast a variable so you don&#8217;t have to declare it&#8217;s type but it wont re typecast.</p>
<p>so</p>
<p>will cause this error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CJ</title>
		<link>http://www.lost-in-code.com/platforms/wordpress/php-cannot-use-a-scalar-value-as-an-array/comment-page-1/#comment-364</link>
		<dc:creator>CJ</dc:creator>
		<pubDate>Wed, 06 May 2009 22:40:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/2008/02/26/php-cannot-use-a-scalar-value-as-an-array/#comment-364</guid>
		<description>I am having a similar error in my site and I cannot figure out how to fix it. I get a &quot;Warning: Cannot use a scalar value as an array in .../query.php on line 2678&quot;

The error is intermittent and I cannot figure out what to do to fix it. I tried adding your code in the top, but nothing seemed to change.

I looked at doug b&#039;s option, but I would rather not edit the core wordpress files if I can avoid it.

Any ideas? Or other places I could look? I&#039;m really stuck on this one...</description>
		<content:encoded><![CDATA[<p>I am having a similar error in my site and I cannot figure out how to fix it. I get a &#8220;Warning: Cannot use a scalar value as an array in &#8230;/query.php on line 2678&#8243;</p>
<p>The error is intermittent and I cannot figure out what to do to fix it. I tried adding your code in the top, but nothing seemed to change.</p>
<p>I looked at doug b&#8217;s option, but I would rather not edit the core wordpress files if I can avoid it.</p>
<p>Any ideas? Or other places I could look? I&#8217;m really stuck on this one&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: doug b</title>
		<link>http://www.lost-in-code.com/platforms/wordpress/php-cannot-use-a-scalar-value-as-an-array/comment-page-1/#comment-193</link>
		<dc:creator>doug b</dc:creator>
		<pubDate>Wed, 19 Nov 2008 18:46:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.lost-in-code.com/2008/02/26/php-cannot-use-a-scalar-value-as-an-array/#comment-193</guid>
		<description>I also had this problem. It&#039;s due to Wordpress setting PHP&#039;s error reporting level more strict than the default settings on your server. Most servers disable warnings since they&#039;re not critical errors (won&#039;t cause your script to die). Wordpress overrides these settings, and it does it in at least 7 locations. Get a decent editor like jedit and do a find in directory for the php function &quot;error_reporting&quot;. Comment out every one. 

There is absolutely no reason for Wordpress to do this, other than to assume that they&#039;re the only thing you have running under PHP on that server. It&#039;s bad form in my book.</description>
		<content:encoded><![CDATA[<p>I also had this problem. It&#8217;s due to WordPress setting PHP&#8217;s error reporting level more strict than the default settings on your server. Most servers disable warnings since they&#8217;re not critical errors (won&#8217;t cause your script to die). WordPress overrides these settings, and it does it in at least 7 locations. Get a decent editor like jedit and do a find in directory for the php function &#8220;error_reporting&#8221;. Comment out every one. </p>
<p>There is absolutely no reason for WordPress to do this, other than to assume that they&#8217;re the only thing you have running under PHP on that server. It&#8217;s bad form in my book.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

