You are here: Re: Problem with array - what's wrong?? « All PHP « IT news, forums, messages
Re: Problem with array - what's wrong??

Posted by Pedro Graca on 02/01/06 20:17

["Followup-To:" header set to comp.lang.php.]
Leszek wrote:
> <pre><?php print_r($_POST['dane']); ?>
> </pre>
> and i'm getting this:
>
> Array
> (
> [1] => Array
> (
> [\'zamow\'] => Array
<snip>

> <pre><?php print_r($_POST['dane'][1]); ?>
> </pre>
>
> Array
> (
> [\'zamow\'] => Array
<snip>

> )But when i'm trying with:<pre><?php print_r($_POST['dane'][1]['zamow']); ?>
> </pre>I'm getting no resultsWhat is wrong? What should to see result?

The single quotes are part of the array index. If you want to print its
value you need to include the single quotes

<?php print_r($_POST['dane'][1]['\'zamow\'']); ?>

or

<?php print_r($_POST['dane'][1]["'zamow'"]); ?>

or even

<?php
$idxA = 'dane';
$idxB = 1;
$idxC = "'zamow'";
print_r($_POST[$idxA][$idxB][$idxC]);
?>

--
If you're posting through Google read <http://cfaj.freeshell.org/google>

 

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

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