You are here: Re: "Array to String Conversion" error when constructing a multi-dimensional array « PHP Programming Language « IT news, forums, messages
Re: "Array to String Conversion" error when constructing a multi-dimensional array

Posted by Erwin Moller on 01/17/07 09:33

drako wrote:

> Hi,
>
> I'm a bit stumped as I am getting a "Notice: Array to String
> Conversion" error when trying to do something that on the surface
> should be a very simple task - create an array, and write a set of
> values to them based on data submitted from POST Fields.
>
> Code below:
>
> $_SESSION["increment"] = array();
> $x = 0 // Counter - This will be
> incremented
>
> $_SESSION["increment"][$x] = array("increment_bond" =>
> $_POST["increment_bond"],
> "increment_amount" => $_POST["increment_amount"],
> "increment_comm_date1" => $_POST["increment_comm_date1"],
> "increment_comm_date2" => $_POST["increment_comm_date2"],
> "increment_comm_date3" => $_POST["increment_comm_date3"]);
>
>
> It keeps throwing out that error, and does not write any of the POST
> Values to the array (the POST values are definitely getting sent, so
> that is not the problem).
>
> If I dump out the value of $_SESSION["increment"], I get "1A" ?!?
>
> I'm sure that there is a pretty simple mistake lurking somewhere - I
> just can't seem to figure it out.
>
> Any suggestions or hints ?
>
> Thanks
> Neil.

Hi Neil,

Your code looks perfectly OK to me.
Are you 100% sure this is where the error is thrown?
Did you try:
<pre>
<?php print_r($_POST); ?>
</pre>

Does it produce all used postvars you expect?

Regards,
Erwin Moller

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация