reloading stored print_r() data back into an array

This is a discussion on reloading stored print_r() data back into an array within the PHP General forums, part of the PHP Programming Forums category; Hi all, I am trying to reload a stored print_r() dump back into a usable array but seem to be ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-15-2005
Somedude
 
Posts: n/a
Default reloading stored print_r() data back into an array

Hi all,

I am trying to reload a stored print_r() dump back into a usable array
but seem to be missing something.

// the retrieved array as stored in the database directly from print_r()
$db_result = 'Array ( [user] => somedude [script] => genPass.php )';

How on earth do I make this into a usable array again where I can call
$arr['user'] or something similar ?!?


Thanks a lot IA,

SomeDude.
Reply With Quote
  #2 (permalink)  
Old 05-15-2005
MRB
 
Posts: n/a
Default Re: reloading stored print_r() data back into an array

Somedude wrote:
> Hi all,
>
> I am trying to reload a stored print_r() dump back into a usable array
> but seem to be missing something.
>
> // the retrieved array as stored in the database directly from print_r()
> $db_result = 'Array ( [user] => somedude [script] => genPass.php )';
>
> How on earth do I make this into a usable array again where I can call
> $arr['user'] or something similar ?!?
>
>
> Thanks a lot IA,
>
> SomeDude.



Why use print_r? Why not use serialize / unserialize instead which is
meant for these kind of things?
Reply With Quote
  #3 (permalink)  
Old 05-15-2005
Somedude
 
Posts: n/a
Default Re: reloading stored print_r() data back into an array

MRB wrote:
> Somedude wrote:
>
>> Hi all,
>>
>> I am trying to reload a stored print_r() dump back into a usable array
>> but seem to be missing something.
>>
>> // the retrieved array as stored in the database directly from print_r()
>> $db_result = 'Array ( [user] => somedude [script] => genPass.php )';
>>
>> How on earth do I make this into a usable array again where I can call
>> $arr['user'] or something similar ?!?
>>
>>
>> Thanks a lot IA,
>>
>> SomeDude.

>
>
>
> Why use print_r? Why not use serialize / unserialize instead which is
> meant for these kind of things?


I am using Pear::Log and that thing dumps array-messages as plain
print_r() data in my database.

Any change on running something like an 'unserialize' on the array-string ?
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:20 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0