userialize hidden field

I have a hidden field at a form that has a serialized array

<input name="data[Machine][data]" value="Machine.CUSTOMER_ID:-1/Machine.DESCRIPTION:/Machine.SERIAL_NUMBER:/Machine.TYPE_OF_SERVICE:-1/Machine.BRAND:/Machine.ACTIVE:-1/Machine.DATE_END:/Machine.DATE_ENDS:/page:2" id="MachineData" type="hidden">

So i want to unserialize this field, so I write the code but it does not work

How can I unserialize this field?

$a=$this->Serialize->unSerializeData($this->data['Machine']['data']);

-------

<?php echo $form->create('Machine',array("action"=>"exports"));?>

<?php echo $form->hidden("values",array ("value"=>$searchParams)); ?>

<?php echo $form->button('Export', array('type'=>'submit'));?>

<?php echo $form->end();?>

Asked by dimis283, on 10/3/10

I used the serialise() of php.

I used also a SerializeComponent of cakephp that did not help me at this situation.

dimis283 - on 10/3/10

<< comments | comments >>

1 Answer

if you are using php serialize() you should use php unserialize() to get the data back

if you just look on the page for the function http://php.net/manual/en/function.serialize.php

you would see the unserialize method

Answered by dogmatic69on 10/3/10

<< previous next >>

Your Answer

You can use Creole Wiki Syntax to format your text.

Tagged with

Rating

0

Viewed

238 times

Last Activity

on 10/3/10