How to use php serialize() and unserialize()

后端 未结 10 1959
Happy的楠姐
Happy的楠姐 2020-11-22 05:03

My problem is very basic.

I did not find any example to meet my needs as to what exactly serialize() and unserialize() mean in php? They ju

10条回答
  •  猫巷女王i
    2020-11-22 05:38

    Yes, I can. Assume we need to track your system means In your system has more than one admin and subadmin, All of these can insert or update or edit any information.Later you need to know who make this change. For solving this problem you need serialize.

      **Explain:**Create a table named history which stores all changes. Each time there is a change insert a new row in this table. It might have this fields:
    
      history(id,target_table(name of the table), target_id (ID of the saved entry),create/edit/change data (serialized data of the saved row),date)
    

    I hope this will help you.

提交回复
热议问题