Jump to content
php.lv forumi

unserialize


goma smile

Recommended Posts

Iekš db saglabā

a:3:{i:1292632517;i:6;i:1292601400;i:5822;i:1292426585;i:2;}

 

 

izvadot

print_r(unserialize($user->last_visitors));

 

Array
(
   [1292632517] => 6
   [1292601400] => 5822
   [1292426585] => 2
)

 

Kā ds var pateikt kā var lai ir

 

[0] => stdClass Object
       (
           [time] =>1292632517
           [user_id] =>6
       )

[1] => stdClass Object
     (
           [time] =>1292601400
           [user_id] =>2
       )
[2] => stdClass Object
     (
           [time] =>1292426585
           [user_id] =>5822
       )

Link to comment
Share on other sites

šita jau nav normāli ... ?

 

$view = unserialize($user->last_visitors);
foreach($view  as $t => $uid){
$res = mysq_query('SELECT members_display_name FROM ibf_members WHERE id='.$uid);
echo '<pre>';
print_r($viewer);
}

Edited by goma smile
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...