vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   unserialize problem (https://vborg.vbsupport.ru/showthread.php?t=67801)

Revan 07-30-2004 07:53 PM

unserialize problem
 
Ive got a bit of serialized text, with this value:
PHP Code:

s:8:"NeoRevan";s:11:"Burnzaquist"

Now when I hit unserialize, I get only "NeoRevan" (without the quotes). It seems to have deleted the other string.

What can be done about this?

Xenon 07-31-2004 11:07 AM

can you please post the complete serialized text?

if you have two strings, then it must be an array, so the array code serializing string would be needed :)

Revan 07-31-2004 12:54 PM

[edit]
w00000000000000t!
I managed to solve the problem, and believe it or not YOU Xenon put me onto the right track with your talk of arrays :D :D :D :D :D

Now all I need is to comma seperate the names after the unserialize.....
[/edit]

[reflection]
I think this ++++ might actually help with the RPG conversion as well :D :D
If thats true then I will start worshipping Xenon XD
[/reflection]

Xenon 07-31-2004 02:28 PM

comma separate?

you might love this function:
http://de3.php.net/manual/en/function.implode.php

Revan 07-31-2004 03:42 PM

nah that didnt work.
But it doesnt look too lame as it does, it just displays an extra comma behind the last name :P

Thanks for ye olde helpe :D

Xenon 07-31-2004 04:06 PM

hmm, implode doesn't add a comma behind the last entry, so you have to make, sure that the last name is also really the last entry.

So an array:
1 => 'Test',
2 => 'Name',
3 => ''

will give an imploded string: 'Test,Name,'

but if you have a correct array
1 => 'Test',
2 => 'Name'

it will result in: 'Test,Name'

Revan 07-31-2004 05:40 PM

No what I said was that the implode itself didnt work.
It didnt implode the comma as it was supposed to.
As of now I got
PHP Code:

foreach ($array as $v1)
{
    foreach (
$v1 as $v2)
    {
         echo 
"$v2, ";
    }


And yes there needs to be 2 foreach cos the array is
Code:

Array (
    [0] => array (
                [username] => "Username 1"
                )
      [1] => array (
                [username] => "username 2"
              )
)

And the array will change number of values based on how many usernames there are.

lol dont ask me how the arrays got stored so silly, I took vB3's own query and modded it to my own need for it. ;)

Xenon 08-01-2004 11:17 AM

ahh, ok, if you have such an array, then implode won't work, you're right ;)


All times are GMT. The time now is 03:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01170 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete