Jump to content

[SOLVED] Unserilize


dropfaith

Recommended Posts

the top one works the bottom doesnt any obvious reason why?

$Archetypes1 = ($row->Archetypes);

$Archetypes2 = unserialize($Archetypes1);

 

 

$Scenes1 = ($row->Scenes);

$Scenes2 = unserialize($Scenes1);

 

ive echoed both Scenes1 and Scenes2

 

Scenes1 (makes the serlized array display on screen

Scenes2 just prints the word array

Link to comment
Share on other sites

its part of a much bigger code im not directly echoing them out that was just for debugging

 

<?php
//Create the array of selected values
$Scenes1 = ($row->Scenes);
$Scenes2 = unserialize($Scenes1);
$checkOptions = array (
'Having a romantic dinner by candlelight', 'I am spanked because I have been a naughty boy or girl', 
'A stranger walks into my bedroom and finds me playing with myselfI am sold on a slave market', 
        'I am a foot slave, forced to care for my Mistress feet', 'I am a piece for furniture, only useful as a tabletop, etc', 
'I am forced to behave as a gender I am not', 'I am a dirty slut and must be punished', 'I am used as a slave in public', 
'I am used as a slave in private', 'I am ordered to please others', 'I am a little schoolgirl or schoolboy', 
'I am sitting/kneeling at my Mistress feet', 'I am are tied and teased', 'I am grabbed by the hair and dragged into the bedroom', 
'I am used as a dog, pony or pet', 'I am verbally humiliated', 'I am tied, gagged and blindfolded and left alone', 
'I am tied, gagged, blindfolded and thoroughly whipped', 'My physical limits are tested and stretched', 
'My mental limits are tested and stretched', 'I am a total slave every day of the week'
    );
foreach ($checkOptions as $option)
{
    $selected = (in_array($option, $Scenes2))?' checked="checked"':'';
    echo "<input type=\"checkbox\" name=\"Scenes[]\" value=\"$option\"$selected />$option<br />\n";
}
echo $Scenes1;
echo "<br />";
echo $Scenes2;
?>

Link to comment
Share on other sites

works i cant see a difference

<?php
//Create the array of selected values
$Archetypes1 = ($row->Archetypes);
$Archetypes2 = unserialize($Archetypes1);
$checkOptions = array (
    'Soldiers, marines, paratroopers', 'Sailors, coast guard, merchant marine',
    'Airmen, pilots', 'Policewomen, security people', 'Truck drivers', 'Firemen',
    'Executioners', 'Nurses, doctors', 'Prostitutes, tramps', 'Cruel/abusive women',
    'Cowgirl', 'Surfers, life guards', 'Biker chicks', 'Warrior/Wrestler', 'Royalty, nobility',
    'Business people. managers, the boss', 'Divas', 'Teachers', 'Daddy', 'Mommy'
    );
foreach ($checkOptions as $option)
{
    $selected = (in_array($option, $Archetypes2))?' checked="checked"':'';
    echo "<input type=\"checkbox\" name=\"Archetypes[]\" value=\"$option\"$selected />$option<br />\n";
}
?>

Link to comment
Share on other sites

the following works fine for me. the only thing i did was manually set the value for $Scenes2 and split two items where you forgot a ',' on line two of the big array

 

<?php
//Create the array of selected values
//$Scenes1 = ($row->Scenes);
//$Scenes2 = unserialize($Scenes1);
$Scenes2 = array(
  'I am spanked because I have been a naughty boy or girl',
  'A stranger walks into my bedroom and finds me playing with myself'
);
$checkOptions = array (
   'Having a romantic dinner by candlelight', 'I am spanked because I have been a naughty boy or girl', 
   'A stranger walks into my bedroom and finds me playing with myself','I am sold on a slave market', 
   'I am a foot slave, forced to care for my Mistress feet', 'I am a piece for furniture, only useful as a tabletop, etc', 
   'I am forced to behave as a gender I am not', 'I am a dirty slut and must be punished', 'I am used as a slave in public', 
   'I am used as a slave in private', 'I am ordered to please others', 'I am a little schoolgirl or schoolboy', 
   'I am sitting/kneeling at my Mistress feet', 'I am are tied and teased', 'I am grabbed by the hair and dragged into the bedroom', 
   'I am used as a dog, pony or pet', 'I am verbally humiliated', 'I am tied, gagged and blindfolded and left alone', 
   'I am tied, gagged, blindfolded and thoroughly whipped', 'My physical limits are tested and stretched', 
   'My mental limits are tested and stretched', 'I am a total slave every day of the week'
);
foreach ($checkOptions as $option)
{
    $selected = (in_array($option, $Scenes2))?' checked="checked"':'';
    echo "<input type=\"checkbox\" name=\"Scenes[]\" value=\"$option\"$selected />$option<br />\n";
}
?>

Link to comment
Share on other sites

Array
(
    [0] => I am spanked because I have been a naughty boy or girl 
    [1] => A stranger walks into my bedroom and finds me playing with myself 
)

 

(edited by kenrbnsn to add


tags)

 

lol wut?

 

Unserialize is quite easy to understand.

 

If you stick an array into serialize() you will get a string. unserialize that string as a var ($var = unser...) and you get that same array structure under the new variable name.

 

Chris

Link to comment
Share on other sites

Array
(
    [0] => I am spanked because I have been a naughty boy or girl 
    [1] => A stranger walks into my bedroom and finds me playing with myself 
)

 

(edited by kenrbnsn to add


tags)

 

lol wut?

 

...yeah...it's taken all of my energy not to comment about the values in the array...

Link to comment
Share on other sites

Array
(
    [0] => I am spanked because I have been a naughty boy or girl 
    [1] => A stranger walks into my bedroom and finds me playing with myself 
)

 

(edited by kenrbnsn to add


tags)

 

lol wut?

 

...yeah...it's taken all of my energy not to comment about the values in the array...

 

I found this especially hilarious:

 

    [0] => I am spanked because I have been a naughty boy or girl

 

Chris

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.