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>
[Back to original message]
|