/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Re-populate array from previous var_dump

Anyone know a quick way to re-populate an array from a text file, with the array structure previously saved to a text file with var_dump?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@BIOSTALLApr 10.2010 — If you serialized the array and saved that to the text file, then you could easily read the text file and unserialize the contents.

var_dump() is more for viewing the contents of the array on screen and I'm pretty sure that without some complex string function use, you won't be able to convert it back to an array.

Hope that helps
Copy linkTweet thisAlerts:
@NogDogApr 10.2010 — I would agree that serialize()/unserialize() would be the way to go.

If stuck with having to parse the var_dump() output, you could try modifying the print_r() parser in [url=http://www.php.net/manual/en/function.print-r.php#93529]this manual user note[/url].
Copy linkTweet thisAlerts:
@hastxauthorApr 10.2010 — Thanks a lot, that is what I needed I will go the serialize route.
×

Success!

Help @hastx spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...