php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #12381 Data Structure Dumper Feature Needed
Submitted: 2001-07-25 18:30 UTC Modified: 2001-07-26 14:29 UTC
From: cdaveb at csua dot berkeley dot edu Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.6 OS: Linux
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: cdaveb at csua dot berkeley dot edu
New email:
PHP Version: OS:

 

 [2001-07-25 18:30 UTC] cdaveb at csua dot berkeley dot edu
I'd like to suggest that a built in function for dumping PHP data structures (arrays, variables, etc.) into a string which could then be exported to a file be created. This would work something like the Perl Data::Dumper module.  This would be extremely useful for creation of persistent datastructures, especially helpful for programs which include web interfaces to edit settings which are used by another portion of the program.

I find myself writing simple code to do this a lot, but it is something that gets pretty  messy whenever I'm trying to recreate multidimensional arrays and such so that they can later be required into a PHP page.  I'm sure that a function of this type would be useful to a lot of PHP users and I hope you'll consider adding it.

I've looked at a lot of the code repository sites by the way, and I haven't found anything that seems to resemble what I'm looking for already available, but I think it's the type of thing that should really be a part of the base PHP.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-26 14:27 UTC] andy@php.net
have you tried something like the serialize and unserialize
functions?

http://php.net/manual/en/function.serialize.php
http://php.net/manual/en/function.unserialize.php
 [2001-07-26 14:29 UTC] andy@php.net
i meant to make this bogus...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 03:01:29 2024 UTC