php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13010 echoed multipdimensional arrays
Submitted: 2001-08-28 20:34 UTC Modified: 2001-08-28 20:43 UTC
From: dcaylor at maf dot org Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.0.4pl1 OS: Linux 7.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dcaylor at maf dot org
New email:
PHP Version: OS:

 

 [2001-08-28 20:34 UTC] dcaylor at maf dot org
Multidemensional arrays seem to not work within an echo.

$variable[one][two] = 'Hi There';
$variable[one][three] = 'This is a bug';

echo "
  <html><body>
  $variable[one][two]<br>
  $variable[one][three]
  </body></html>
";

results in 
  Array[two]
  Array[three] 
rather than the expected
  Hi There
  This is a bug

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-28 20:43 UTC] cardinal@php.net
Multidimensional arrays need to be enclosed in curly braces to be interpolated in that manner.

echo "This is not a bug.  {$array[one][two]}";

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC