unserialize() isn't working....

From: Sebastian Aguilera (sebastian_aguilera_at_nospam.spray.se)
Date: 11/28/03


Date: Fri, 28 Nov 2003 21:46:11 GMT

Hi everyone.
I have some troubles using the unserialize() function.

I have serialized an array and that works perfect:

echo '<input type="hidden" name="vardekedja" value="'.serialize($_POST
['vardekedja']).'">';

Gives the output:
a:3:{i:0;s:7:

Then on a later page I write:
$vardekedja = $_POST['vardekedja'];
$varde = unserialize($vardekedja);
echo $vardekedja; echo '
';
echo $varde; echo '
';
echo 'why?';

And, as I echoed out, WHY?

why isn't it working??

Please help!
/Sebastian



Relevant Pages

  • Re: Dynamic Form
    ... customer will answer all 5 questions then press next. ... I have read the PHP manual pages. ... echo Age; ... only other thought is that for some reason, I can't access the array ...
    (comp.lang.php)
  • Re: Referencing Korn Shell Array Names as a Variable
    ... Your idea worked for displaying the output from the command. ... $ echo $ ... # Attempt to use variable array name and index to reference array value ... The issue is with this line of the script ...
    (comp.unix.shell)
  • Re: PHP Search & Links
    ... >> file as an array. ... >and to tell you the truth it is the first time i see something like ... I have replaced the $ at times or the echo I ... the part displaying the lines should display all lines and ...
    (alt.php)
  • Re: Best approach for server side Form Validation ?
    ... correct I need to submit to another page that uses the form data. ... in 2.php with default parameters (0 for error variable, and an array of ... for each required field use: ... for all fields use interpolated arrayvalue to, e.g., echo ...
    (comp.lang.php)
  • Re: How to perform conditional?
    ... A common situation where === makes sense is a functioncall that can return 0 ... // This function returns the number of elements in an array ... echo "number of elements $result"; ... If you feed this, PHP will correctly count 0 elements, and thus return 0. ...
    (comp.lang.php)